MySQL Forums
Forum List  »  Optimizer & Parser

Re: All records scanning using "LIKe" and "IN" operaters
Posted by: Øystein Grøvlen
Date: August 28, 2014 03:47PM

Peter Brawley Wrote:
-------------------------------------------------------
> Did you try adding a covering index on
> (service_name,circle,status)> BTW, unless you have
> case sensitivity turned on, Upper() is redundant.

With the suggested index, the query will only be able to use the service_name part since that has a range condition (service_name LIKE 'm_%'). (Also, it will not be covering since there are other columns in the select list.)

Upper() is not only redundant, it will prevent the use of index for this condition.

Hence, an index on (status, service_name) or e.g., (circle, status, service_name) if upper() is removed, should work better.

Regards,

Øystein Grøvlen,
Senior Principal Software Engineer,
MySQL Group, Oracle,
Trondheim, Norway

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: All records scanning using "LIKe" and "IN" operaters
1216
August 28, 2014 03:47PM


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.