MySQL Forums
Forum List  »  Newbie

Using Regular Expressions in WHERE and its effect on indexes
Posted by: harryzhong
Date: July 26, 2005 01:31AM

Hi

Im keeping track of different entries and I'm using a REGEXP to select all entries that start with say '123', like this:

SELECT * FROM mytable where id REGEXP '^123';

BUt when i do EXPLAIN, it says that its not using the indexes even though 'id' in this case is a unique index. Is there a way to use regexp with indexes? Thanks for any input!

Harry

Options: ReplyQuote


Subject
Written By
Posted
Using Regular Expressions in WHERE and its effect on indexes
July 26, 2005 01:31AM


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.