[TYPO3] Slow query
daniel at typoconsult.dk
Wed Sep 27 15:51:12 CEST 2006
> My web hotel gave me an alert for a slow SQL query that took 16 seconds.
> When I ran the same question in PHPmyAdmin, it took 6 seconds, which is
> shorter but still pretty long.
> I guess the query came from macina-searchbox. How can I speed it up?
> Here's the query:
> SELECT IR.phash
> FROM index_words IW,
> index_rel IR,
> index_section ISEC
> IW.baseword LIKE '%Ã¤ngsholmmen%'
> AND IW.wid=IR.wid
> AND ISEC.phash = IR.phash
> AND ISEC.rl0 IN (130)
> AND is_stopword=0
> GROUP BY IR.phash;
Try running it in phpmyadmin with:
EXPLAIN SELECT IR.phash
FROM index_words IW,
IW.baseword LIKE '%Ã¤ngsholmmen%'
AND ISEC.phash = IR.phash
AND ISEC.rl0 IN (130)
GROUP BY IR.phash;
Thats is always the first place to start debugging a slow SQL query.
This will give you information on how many rows scanned in the tables
More information about the TYPO3-english