MySQL Forums
Forum List  »  General

Re: Why are no indexes used in this case?
Posted by: Peter Brawley
Date: February 03, 2013 04:04PM

> the query shown is the same as the one before

False. If your 2nd query were the same, the first suggested revision would work with it.

> I don't know to rewrite the query

Again: replace IN( SELECT ...) calls with JOINs.

> why the primary key on ID is not used.

Again: JOINs generally use indexes more efficiently than IN(SELECT...).

Options: ReplyQuote


Subject
Written By
Posted
Re: Why are no indexes used in this case?
February 03, 2013 04:04PM


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.