far too many queries reuqired to built the search result set
when showing the latest 5 content items in the user contribution block we have about 60 addition queries.
this is beaucse of the way /modules/content/include/search.inc.php creates the result set. in the end it calls getObject whichs triggers toArray (because asobject is set to false). in icmspersistableobject, the function toArray uses getVar without the 'e' parameter which results in calling the user defined functions in /modules/content/class/content.php class ContentContent.
At least one of these user defined functions does one query per content item.
Assume we have a news magazin website using iCMS with the content module. They might have 5.000 Content pages. When they show 20 items per page on the content overview page the page requieres at least 20* 5.000 = 100.000 Queries.
Result: Some of the user defined functions + the way the search function of the content module is working should be rewritten to use less sql queries.
this is beaucse of the way /modules/content/include/search.inc.php creates the result set. in the end it calls getObject whichs triggers toArray (because asobject is set to false). in icmspersistableobject, the function toArray uses getVar without the 'e' parameter which results in calling the user defined functions in /modules/content/class/content.php class ContentContent.
At least one of these user defined functions does one query per content item.
Assume we have a news magazin website using iCMS with the content module. They might have 5.000 Content pages. When they show 20 items per page on the content overview page the page requieres at least 20* 5.000 = 100.000 Queries.
Result: Some of the user defined functions + the way the search function of the content module is working should be rewritten to use less sql queries.
Leave a comment
In revision:20112: also including a first enhancement to reduce the amount of queries required to build a content item. work in progress.