MySQL Forums
Forum List  »  Performance

Re: Queries returning large number of rows
Posted by: Björn Steinbrink
Date: May 22, 2006 09:04AM

For that query, the index will not work. MySQL can only use an index if you use a prefix of it. So your index on (current_entry, previous_entry) will work for:
... WHERE current_entry LIKE 'whatever%';
... WHERE current_entry LIKE 'foo%' AND previous_entry like 'bar%'
But not for:
... WHERE previous_entry LIKE 'whatever%'

For the latter you need an index that starts with previous_entry.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Queries returning large number of rows
1808
May 22, 2006 09:04AM


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.