List:General Discussion« Previous MessageNext Message »
From:Ananda Kumar Date:July 10 2012 11:25am
Subject:Re: Query take too long time - please help!
View as plain text  
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 <darekmaciera@stripped>wrote:

> 2012/7/10 Ananda Kumar <anandkl@stripped>:
> > 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
>
>

Thread
Fwd: Query take too long time - please help!Darek Maciera10 Jul
  • Re: Query take too long time - please help!Ananda Kumar10 Jul
  • Re: Fwd: Query take too long time - please help!Carsten Pedersen10 Jul
    • RE: Fwd: Query take too long time - please help!Rick James16 Jul