opengeek/getResources — Issue #56: Extremely slow execution time
Author: leoandrews
Created: 2011-10-31 22:51:37+00:00
State: open

Two issues in as many days - apologies however this is a big one. One of my getResources requests takes 2.5 seconds to complete but more worrying is the below which takes nearly 7 seconds and only has to return 5 items. How can this be optimised??

[[!getResources? &resources=`[[*hpHighlightsIDlist:default=`3`]]` &limit=`` &tpl=`tpl_SubPageDirList` &includeTVs=`1` &processTVs=`0` &sortby=`{"FIELD(modResource.id,[[*hpHighlightsIDlist:default=`3`]])","ASC"}` &parents=`-1` &debug=`1`]]

The TV _hpHighlightsIDlist_ contains five resource ID's

From the error log

[2011-10-31 15:43:14] (ERROR @ /index.php) SELECT `modResource`.`id`, `modResource`.`type`, `modResource`.`contentType`, `modResource`.`pagetitle`, `modResource`.`longtitle`, `modResource`.`description`, `modResource`.`alias`, `modResource`.`link_attributes`, `modResource`.`published`, `modResource`.`pub_date`, `modResource`.`unpub_date`, `modResource`.`parent`, `modResource`.`isfolder`, `modResource`.`introtext`, `modResource`.`richtext`, `modResource`.`template`, `modResource`.`menuindex`, `modResource`.`searchable`, `modResource`.`cacheable`, `modResource`.`createdby`, `modResource`.`createdon`, `modResource`.`editedby`, `modResource`.`editedon`, `modResource`.`deleted`, `modResource`.`deletedon`, `modResource`.`deletedby`, `modResource`.`publishedon`, `modResource`.`publishedby`, `modResource`.`menutitle`, `modResource`.`donthit`, `modResource`.`privateweb`, `modResource`.`privatemgr`, `modResource`.`content_dispo`, `modResource`.`hidemenu`, `modResource`.`class_key`, `modResource`.`context_key`, `modResource`.`content_type`, `modResource`.`uri`, `modResource`.`uri_override` FROM `modx_site_content` AS `modResource` WHERE ( ( modResource.parent IN (-1) AND `modResource`.`deleted` = 0 AND `modResource`.`published` = 1 AND `modResource`.`hidemenu` = 0 ) OR `modResource`.`id` IN (13,14,25,4) )
[2011-10-31 15:43:20] (ERROR @ /index.php) modSnippet: getResources executed in 6.3166 s