| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
MySQL uses a cost based optimizer to find out the best way to resolve a query. In many cases MySQL can calculate the best possible query plan but in some cases MySQL doesn't have enough information about the data at hand and have to do some 'educated' guesses about the data.
This manual section is intended for the cases when MySQL doesn't get it right.
The tools one has available to help MySQL do the 'right' things are:
EXPLAIN. See section EXPLAIN.
ANALYZE TABLE. See section ANALYZE TABLE.
USE INDEX, FORCE INDEX and IGNORE INDEX. See section 13.1.7 SELECT Syntax.
STRAIGHT JOIN. See section 13.1.7 SELECT Syntax.
SHOW VARIABLES.
| A.6.1 How to avoid table scan,,, |