So I asked David Strauss, the new Drupal resident SQL expert what he thinks of the optimization described in the earlier article. He says, not bad, but if you add n.changed to term_node and index that then the query will speed up. And it did, in a spectacular fashion. Keeping term_node.changed in sync with node.changed can be either done with an INSERT BEFORE trigger or with a nodeapi module with a module weight which is higher than of taxonomy. We picked the latter because it fits more into our code flow and easier to document.
Commenting on this Story is closed.