3 ms·
MySQL's query plan is odd at times. What does an explain look like on that query? If any portion of the query, including subselects isn't able to use an index
by cd34 16y ago
MySQL's query plan is odd at times. What does an explain look like on that query? If any portion of the query, including subselects isn't able to use an index, it will report it. You can try to force indicies with USE INDEX/FORCE INDEX which can sometimes help.
- Luyt 16y agoThank you for these tips. I'll try them out later today.
- Luyt 16y agoAh, I was having trouble with another slow query; however, the EXPLAIN showed that the correct indices were used. I managed to speed it up by restricting the size of the inner SELECT with some extra constraints. From 4 seconds downto 0.1 seconds!
- cd34 16y agohttp://cd34.com/blog/scalability/mysql-query-optimization/ http://cd34.com/blog/scalability/mysql-query-optimization/ http://cd34.com/blog/scalability/mysql-5-1s-query-optimizer/ http://cd34.com/blog/scalability/mysql-5-1s-query-optimizer/