MySQL Forums
Forum List  »  MyISAM

Re: Index Keys of the table
Posted by: Rick James
Date: November 02, 2012 08:21PM

There is a big difference between these:
WHERE name LIKE 'Lee%'
WHERE name LIKE '%Lee%'

The first one (without the leading wildcard) can use INDEX(name).
The second one cannot; it will scan the entire table (unless there is something else useful in the WHERE clause.

A full table scan of 405MB will be slow.

Based on your last comment, only WHERE DOB = '...' will be able to use an index.

Options: ReplyQuote


Subject
Views
Written By
Posted
3015
October 28, 2012 11:01PM
1731
October 30, 2012 11:59AM
1637
November 01, 2012 08:05PM
Re: Index Keys of the table
1700
November 02, 2012 08:21PM
1385
November 04, 2012 08:54PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.