for my front page i use the category menu item from K2.
the following SQL got executed and it take more than 11 sec
SELECT i.*, c.name as categoryname,c.id as categoryid, c.alias as categoryalias, c.params as categoryparams
FROM t0nbl_k2_items as i RIGHT JOIN t0nbl_k2_categories AS c
ON c.id = i.catid
WHERE i.published = 1
AND i.access IN(1,1,5)
AND i.trash = 0
AND c.published = 1
AND c.access IN(1,1,5)
AND c.trash = 0
AND c.language IN ('ar-AA','*')
AND i.language IN ('ar-AA','*')
AND ( i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= '2015-10-14 07:10:28' )
AND ( i.publish_down = '0000-00-00 00:00:00' OR i.publish_down >= '2015-10-14 07:10:28' )
ORDER BY i.id DESC
LIMIT 0, 14
and here is the stacktrace from the debuger
JROOT/components/com_k2/models/itemlist.php:357
JROOT/components/com_k2/views/itemlist/view.html.php:376
JROOT/libraries/legacy/controller/legacy.php:693
JROOT/components/com_k2/controllers/controller.php:20
JROOT/components/com_k2/controllers/itemlist.php:49
JROOT/libraries/legacy/controller/legacy.php:730
JROOT/components/com_k2/k2.php:63
JROOT/libraries/cms/component/helper.php:352
JROOT/libraries/cms/component/helper.php:332
JROOT/libraries/cms/application/site.php:191
JROOT/libraries/cms/application/site.php:237
JROOT/libraries/cms/application/cms.php:251
JROOT/index.php:40
any advice how optimize this.
more info:
it seams none of the indexes are used because for c table it use "Using where; Using temporary, filesort" and for i "Using where"