MySQL Forums
Forum List  »  Performance

Re: Optimize LIKE '%abc%' queries
Posted by: Apachez
Date: August 04, 2006 02:36PM

Well in this case it is already normalized.

This means that col1 only contains one word at a time.

The problem I have noticed is that a search such as LIKE '%abc%' (mean a word containing the phrase "abc") will take some time because mysql cannot use index for that (or rather it will be a full indexscan since it doesnt know where to begin).

For example my table can look like:
[col1]
defg
abc
123abc134
1ab456

and so on...

Options: ReplyQuote


Subject
Views
Written By
Posted
15705
August 04, 2006 02:12PM
6906
August 04, 2006 02:30PM
Re: Optimize LIKE '%abc%' queries
6302
August 04, 2006 02:36PM
5883
August 04, 2006 02:56PM
6905
August 04, 2006 03:35PM
5428
August 10, 2006 12:41PM
4758
August 10, 2006 01:54PM
5590
August 10, 2006 04:12PM
4096
August 10, 2006 04:27PM


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.