Bug #430 | Optimisation | ||
---|---|---|---|
Submitted: | 14 May 2003 5:41 | Modified: | 14 May 2003 15:29 |
Reporter: | Henryk Szal | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 3.23.52-max-debug-log | OS: | Windows (Windows) |
Assigned to: | CPU Architecture: | Any |
[14 May 2003 5:41]
Henryk Szal
[14 May 2003 15:29]
Michael Widenius
MySQL can use an index on the 'a' column in both the given cases. MySLQ may however prefer to do a table scan if the given range matches too many rows, as a table scan is quite fast. This is described in more detail in the MySQL manual. Note that MySQL can only use index efficiently for queries where MySQL can create a range for the index. If you have A < CONST and B > CONST MySQL can solve the query by serching from the key (A,B) forward until the end of file. If you have A < CONST and B > CONST the MySQL can solve the query by searching between keys (NULL, B) -> (A,NULL)