[development] comments as nodes

Karoly Negyesi karoly at negyesi.net
Tue Jun 5 07:48:54 UTC 2007


> We are getting to the point with schema where we can load a node with 
> just a single query. It needs bit more work, but i think this is a 
> solvable problem for D7.

Really depends on what we to achieve. If we say, one query to retrieve the nids of the nodecomments and then one query to load a node, then probably yes. You do not want to JOIN all this into one huge query, see the one-to-one tables considered harmful on why (keys can't span tables, filesort hell). And adding foreign keys might happen in D6, it's not a big deal :)

So at best we have one more query per nodecomment compared to what we have now. That's better than the five or so I feared originally but still :)

> Some versions of the node_rendering patch had a 'style' whereby nodeapi 
> 'view' op was skipped. That might be useful here. Otherwise, I think we 
> need to look at each slow nodeapi op and accelerate it, or make it 
> configurable by type. I am encouraged that Robert's sites are working 
> fine with nodecomment.

I am not. Look at http://groups.drupal.org/node/3550#comment-10454 -- there are few nodecomments per node. And whatever you do, it'll be slower than just slapping the filtered comment body to output. However, I am not too afraid of this part -- we can overcome these problems.

So it seems the next step is adding foreign keys to schema and bench the outcome.

Regards,

NK


More information about the development mailing list