ContentOperations class and show_in_menu attribute
Posted: Mon Jun 06, 2011 9:34 pm
I'm having speed trouble with my CMSMS website (1.9.4.2) and i know what the issue is but i would like to know the reasoning behind the GetAllContentAsHierarchy function and maybe a solution that i am overlooking right now.
My situation is as follows. I have 30 pages with type 'Content'. I also have a UDT of which i would like to include into the search results of CMSMS. So i thought why not add an internal link for every possible result so that it would show up in the search results. There are 1400 possible results in this UDT so i have added 1400 pages of type 'Internal Link' with the show_in_menu attribute set to 0 because i only want them to show up in the search. If i use the default setup and load the website this will take alot of time:
This query is called everytime a page is loaded and i thought, why not add a 'WHERE show_in_menu = '1' ' clause. This speeded up the site again:
But then the pages longer show up in the search results (doh!). Any idea how i should approach this (besides from upgrading hw)? I can add a parameter to GetAllContentAsHierarchy and fix the search module to call it with that option but IMHO i cannot see the need to do a select on all the contents of the cms_content table if you are not going to use it. Can someone tell me why this is done? Perhaps a 'exclude not shown in menu' parameter for GetAllContentAsHierarchy is something to consider.
My situation is as follows. I have 30 pages with type 'Content'. I also have a UDT of which i would like to include into the search results of CMSMS. So i thought why not add an internal link for every possible result so that it would show up in the search results. There are 1400 possible results in this UDT so i have added 1400 pages of type 'Internal Link' with the show_in_menu attribute set to 0 because i only want them to show up in the search. If i use the default setup and load the website this will take alot of time:
Code: Select all
debug: (1.39307) - (usage: 7431664) - (peak: 7592996)
(postgres8): SELECT id_hierarchy,content_alias FROM cms_content ORDER BY hierarchy
Debug display of 'Start Loading Children into Tree':(1.416481) - (usage: 7688232) - (peak: 7713088)
Debug display of 'End Loading Children into Tree':(3.692203) - (usage: 9228976) - (peak: 9680156)
Debug: (3.692358) - (usage: 9229164) - (peak: 9680156)
Code: Select all
Debug: (0.234564) - (usage: 7434708) - (peak: 7596804)
(postgres8): SELECT id_hierarchy,content_alias FROM cms_content where show_in_menu = '1' ORDER BY hierarchy
Debug display of 'Start Loading Children into Tree':(0.235227) - (usage: 7439140) - (peak: 7596804)
Debug display of 'End Loading Children into Tree':(0.241096) - (usage: 7564320) - (peak: 7605892)
Debug: (0.241175) - (usage: 7564508) - (peak: 7647284)