MySQL Forums
Forum List  »  Performance

Re: Trim function in MySQL
Posted by: Rick James
Date: April 13, 2009 11:42AM

Rule: When using an indexed field in a WHERE clause, the index will not be used you you hide in any form of function.

Recommend you cleanse your data before putting it into the database. That is, do the TRIM as you do the INSERT.

Alternatively, you could have another column with the trimmed, lowercased, etc, value you want to search on. This column, not the original, would be indexed.

Options: ReplyQuote


Subject
Views
Written By
Posted
11785
April 13, 2009 05:45AM
Re: Trim function in MySQL
4350
April 13, 2009 11:42AM
3464
April 15, 2009 11:16PM


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.