trf complained about excessive Menu queries the other day.
Examining SELECT statements generated on my test system showed:
Home Page: 120 SELECTs, 40 are menu_link retrievals
http://localhost/staging/article/id/381: 79 SELECTs, 40 are menu_link retrievals
menu_link retrieval query (only difference is value of menu_links.parent:
SELECT menu_links.* FROM menu_links
LEFT JOIN phpws_key
ON menu_links.key_id = phpws_key.id
WHERE ( menu_links.parent = '173' )
AND ( ( menu_links.key_id = '0' )
OR ( phpws_key.active = '1' ) )
ORDER BY menu_links.link_order
After I made changes to Menu_Item.php, Menu_Link.php & close.php I got this:
Home Page: 80 total SELECTs
http://localhost/staging/article/id/381: 39 total SELECTs
tested on my data as well as by trf on his production system. In both cases page creation time was sped up greatly.
Multifile Patch with recursed subfolders (Eclipse)