"rich johnson" <[EMAIL PROTECTED]> wrote: > > Short question: I understand that MySQL in some circumstances > may decide that it's faster to do a full table scan rather than use > the index to look up values. > > But I miss some information on *when* this happens. Is there some > way, short of reading the source code, that one can get some more > details on this subject? >
Look in the manual: http://www.mysql.com/doc/en/MySQL_indexes.html " If the use of the index would require MySQL to access more than 30% of the rows in the table. (In this case a table scan is probably much faster, as this will require us to do much fewer seeks.) Note that if such a query uses LIMIT to only retrieve part of the rows, MySQL will use an index anyway, as it can much more quickly find the few rows to return in the result. " -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]