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 <darekmaci...@gmail.com>wrote: > 2012/7/10 Ananda Kumar <anan...@gmail.com>: > > 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 > >