From: Peter Brawley Date: July 7 2012 5:01pm Subject: Re: Subquery taking too much time on 5.5.18? List-Archive: http://lists.mysql.com/mysql/227786 Message-Id: <4FF86B54.2080506@earthlink.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2012-07-07 9:52 AM, Cabbar Duzayak wrote: > Hmm, > > Looking at the link http://www.artfulsoftware.com/infotree/queries.php > and explanations here, EXISTS() should have performed better, but does > not seem to??? I stopped it after about 5 minutes. > > I tried both: > > SELECT * FROM A WHERE EXISTS (SELECT * FROM B WHERE A.id=B.A_ID and > B.name like 'X%'); > > and > > SELECT * FROM A WHERE EXISTS (SELECT B.A_ID FROM B WHERE A.id=B.A_ID > and B.name like 'X%'); > > Both are slow... What's the optimizer_switch setting? PB