Tagwolke - sql query zu langsam

Wenn wir Tagwolke einschalten - Shop ist zu langsam. in Funktion sBuildTagCloud (core/class/sMarketing.php) die Abfrage(ab Zeile 337) dauert über 5 sec. # Time: 150215 0:36:15 # Thread\_id: 216 Schema: shop QC\_hit: No # Query\_time: 5.524476 Lock\_time: 0.000073 Rows\_sent: 46 Rows\_examined: 3411149 # Full\_scan: No Full\_join: No Tmp\_table: Yes Tmp\_table\_on\_disk: No # Filesort: Yes Filesort\_on\_disk: No Merge\_passes: 0 Priority\_queue: Yes # # explain: id select\_type table type possible\_keys key key\_len ref rows Extra # explain: 1 SIMPLE c const PRIMARY PRIMARY 4 const 1 Using temporary; Using filesort # explain: 1 SIMPLE ac ref articleID,categoryID,articleID\_2,categoryID\_2,category\_id\_by\_article\_id categoryID 4 const 505776 # explain: 1 SIMPLE a eq\_ref PRIMARY,product\_newcomer,get\_category\_filters PRIMARY 4 shop.ac.articleID 1 Using where # explain: 1 SIMPLE r ref articleID,time articleID 4 shop.ac.articleID 1 Using where # explain: 1 SIMPLE ag eq\_ref articleID articleID 8 shop.ac.articleID,const 1 Using where; Using index; Not exists # SET timestamp=1423956975; SELECT a.id as articleID, a.name as articleName, COUNT(r.articleID) as relevance FROM s\_articles a INNER JOIN s\_articles\_categories\_ro ac ON ac.articleID = a.id AND ac.categoryID = 3 INNER JOIN s\_categories c ON c.id = ac.categoryID AND c.active = 1 LEFT JOIN s\_emarketing\_lastarticles r ON a.id = r.articleID AND r.time \>= DATE\_SUB(NOW(),INTERVAL 30 DAY) LEFT JOIN s\_articles\_avoid\_customergroups ag ON ag.articleID=a.id AND ag.customergroupID=1 WHERE a.active = 1 AND ag.articleID IS NULL GROUP BY a.id ORDER BY COUNT(r.articleID) DESC LIMIT 46; Kann man die Abfrage umschreiben?

Am einfachsten wäre hier den SQL vernünftig an den Bedürfnissen anzupassen.