We're getting a lot of slow transaction reports from nodewords SELECT queries (mainly from nodewords_custom, but I'll file another issue for that).
In general, why would nodewords_load_tags() be called at all, if the node that's being loaded is in teaser mode? It generates a lot of queries on list pages without any obvious benefit...or am I missing something conceptually?
Thanks for any clarification....
Comments
Comment #1
damienmckennaThe nodewords are loaded during node_load(), which does not know what the desired build_mode is yet, we would have to change the loading mechanism to avoid that.
Comment #2
nicolash commentedMaybe I'm looking at the wrong place, but couldn't the build mode be checked in hook_nodeapi()?
Comment #3
damienmckennaPlease check the API:
When node_load() is called it does not know what the build mode is going to be, $a3 and $a4 are both NULL.
Comment #4
nicolash commentedHa, thanks Damien.
And doing something hackish like
to make sure this only gets loaded on a detail view probably opens up another can of worms?
Comment #5
damienmckenna@NicolasH: exactly, we'll need to re-examine this later, after we have a solid 1.x release again.
Comment #6
damienmckennaI updated the title to be more descriptive of the core problem.
Comment #7
damienmckennaWould it be wrong to do a check to see if the current node is the one being loaded?
We're already doing something similar for users:
Another idea would be to completely stop loading data in both hook_nodeapi() & hook_user() and just loading it via template_preprocess_page() so that the data is only ever loaded if it's appropriate for that page.
Thoughts?
Comment #8
damienmckennaI'm thinking of going a step further and *not* doing any data loading until it gets to nodewords_preprocess_page(), and only then decide what to do..
Comment #9
damienmckennaDeclaring my intentions.
Once that's done I'll be able to cache the results.
Comment #10
damienmckennaBumping this to v2.
Comment #11
damienmckennaMarking all v2 issues as postponed while v1 is finished off.
Comment #12
damienmckennaUnfortunately this module is no longer supported, so I'm closing this issue.