If the collation for ksd in ..._ci, then it is "case-insensitive", and you can 
get rid of both calls to LOWER().

> -----Original Message-----
> From: Carsten Pedersen [mailto:cars...@bitbybit.dk]
> Sent: Tuesday, July 10, 2012 11:22 AM
> To: Darek Maciera
> Cc: mysql@lists.mysql.com
> Subject: Re: Fwd: Query take too long time - please help!
> 
> On 10.07.2012 13:16, Darek Maciera 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
> > mysql> LOWER(ksd)=LOWER('4204661375');
> 
> That's definitely not the query you showed the first time around. The
> query you're showing here will force a table scan to calculate
> LOWER(ksd) for every single row.
> 
> Also, how do you know that ksd id unique (as stated in your original
> post)? You have no index on it to ensure uniqueness.
> 
> You'll have to find some other way to query the table.
> 
> Best,
> 
> / Carsten
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql

Reply via email to