[drupal-devel] forum module query optimisation

Gabor Hojtsy gabor at hojtsy.hu
Sun Jun 19 18:48:54 UTC 2005


Cheers Dries,

Replying on the development list.

> did you had the chance to look into that forum.module SQL cleanup?

Yes, indeed. The problem is that the logic buried in the forum code for
handling shadow copies turns up too often, and I cannot get the picture.

As far as I see, the whole code is too much reliant on having a
$node->tid, which needs a query to become a property of the node object
(thanks to forum_load()), and it is probbaly only possible to omit this
query with deep overthinking of how forums work. The hook_link() and
hook_view() implementations both need this tid.

True, there is no need to have this tid just to display a list of forum
topics, or some other metadata, but the whole node_load() concept is
built upon the fact that you will need the data loaded in. So maybe
those list displays need to use some light load mechanism. Oterwise
there is no performance penalty of supporting shadow copies, since we
would only replace {forum} with {term_node} in the often used queries,
and would only remove some administrative (insert, update, delete)
queries with dropping the shadow copy feature.

Gabor



More information about the drupal-devel mailing list