From: Ananda Kumar Date: July 10 2012 11:25am Subject: Re: Query take too long time - please help! List-Archive: http://lists.mysql.com/mysql/227794 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8ff1bff614c53a04c477fc2e --e89a8ff1bff614c53a04c477fc2e Content-Type: text/plain; charset=ISO-8859-1 you are using a function-LOWER, which will not make use of the unique key index on ksd. Mysql does not support function based index, hence your query is doing a FULL TABLE scan and taking more time. On Tue, Jul 10, 2012 at 4:46 PM, Darek Maciera wrote: > 2012/7/10 Ananda Kumar : > > can u show the explain plan for your query > > > > Thanks, for reply! > > Sure: > > mysql> EXPLAIN SELECT * FROM books WHERE LOWER(ksd)=LOWER('4204661375'); > > +----+-------------+-------------------------+------+---------------+------+---------+------+--------+-------------+ > | id | select_type | table | type | possible_keys | > key | key_len | ref | rows | Extra | > > +----+-------------+-------------------------+------+---------------+------+---------+------+--------+-------------+ > | 1 | SIMPLE | books | ALL | NULL | > NULL | NULL | NULL | 378241 | Using where | > > +----+-------------+-------------------------+------+---------------+------+---------+------+--------+-------------+ > 1 row in set (0.00 sec) > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql > > --e89a8ff1bff614c53a04c477fc2e--