MySQL Forums
Forum List  »  Performance

Re: No response to SELECT with IN clause
Posted by: Peter Brawley
Date: April 21, 2014 09:54PM

Before 5.7.3, MySQL does not optimise semijoins like IN(SELECT...) at all well (see "The unbearable slowness of IN()" at http://www.artfulsoftware.com/queries.php).

Give tblIR index(idir), give tbler index(idir,idlrevent), then rewrite the query as a simple join ...

select a.idir,a.surname,a.givenname,a.birthd,a.idlrbirth
from tblir a
join tbler b using(idir)
where b.idtype=0 and b.idlrevent in(...your long list of values...);

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: No response to SELECT with IN clause
852
April 21, 2014 09:54PM


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.