MySQL Forums
Forum List  »  Newbie

Re: SELECT with multiple WHERE statments (using an index)
Posted by: Sean Nolan
Date: April 06, 2005 11:10AM

If you use the LIKE operator and you have a wildcard at the beginning of the search text (for example firstname LIKE '%$firstname%') then an index cannot be used and MySql has to look at each row individually, so performance for larger amounts of data will be poor. For that kind of searching full text indexing will be better.

To optimize your soundex searches you could create an extra column that matches the real column and stores the soundex, then index on that soundex column.

Also - be very careful about just concatenating values entered by users - if this is for a public application you'll open yourself to SQL injection attacks.

Sean Nolan

Options: ReplyQuote


Subject
Written By
Posted
Re: SELECT with multiple WHERE statments (using an index)
April 06, 2005 11:10AM


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.