I looked at devel_query report of one of views on my site and noticed that if the view lists 10 nodes it calls 'page_title_load_title' 10 times. This is related to the fact that View uses entity_load to render Fields, so if we have some node fields attached to the view we will fire up node_load() for each record. This in its own way, will issue a call for everything what is attached to hook_node_load(), including page_title_node_load(). "Having 10 separate queries isn't a good thing", I thought, and redone page_title_node_load() to support loading all page_titles at once. Now we have only one query to load all page titles on a page.

Please see the patch attached.

Comments

nicholasthompson’s picture

Status: Needs review » Fixed

Nice catch - committed here: http://drupalcode.org/project/page_title.git/commit/b2eef2dbeb15c6f5f14c...

I might also look to move to the DBTNG approach to queries rather than the plain text SQL approach. I also might look into generalising the loading multiple titles approach.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.