From: Perrin Harkins Date: February 24 2010 5:08pm Subject: Re: EXPLAIN says DEPENDENT SUBQUERY despite no free variables List-Archive: http://lists.mysql.com/mysql/220794 Message-Id: <66887a3d1002240908s678fa4a7gac570ffe50d5511@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Feb 24, 2010 at 10:11 AM, Yang Zhang wrote: > Any ideas on > how to optimize this by convincing mysql to see the independence use a > const join? http://www.xaprb.com/blog/2006/04/30/how-to-optimize-subqueries-and-joins-in-mysql/ You need to rewrite as a join or use a FROM subquery. You should pretty much always avoid using IN/NOT IN. - Perrin