List:General Discussion« Previous MessageNext Message »
From:Baron Schwartz Date:February 25 2010 8:34pm
Subject:Re: EXPLAIN says DEPENDENT SUBQUERY despite no free variables
View as plain text  
Hello,

On Wed, Feb 24, 2010 at 10:11 AM, Yang Zhang <yanghatespam@stripped> wrote:
> I have the following query. Note that the nested query has no
> dependencies on the outer one, yet mysql reports it as dependent.

Do an EXPLAIN EXTENDED followed by SHOW WARNINGS.  You will see the
"optimization" that mysqld applies to the subquery, to try to help it
by adding a dependency on the outer query.

There's nothing you can do about this :-(  You have to use a JOIN in most cases.

BTW, the general log is itself a performance killer when logged to
tables.  If I were you I'd use the slow query log and mk-query-digest
from Maatkit.
Thread
EXPLAIN says DEPENDENT SUBQUERY despite no free variablesYang Zhang24 Feb
  • Re: EXPLAIN says DEPENDENT SUBQUERY despite no free variablesPerrin Harkins24 Feb
    • Re: EXPLAIN says DEPENDENT SUBQUERY despite no free variablesDan Nelson25 Feb
      • Re: EXPLAIN says DEPENDENT SUBQUERY despite no free variablesJohan De Meersman25 Feb
      • Re: EXPLAIN says DEPENDENT SUBQUERY despite no free variablesPerrin Harkins25 Feb
  • Re: EXPLAIN says DEPENDENT SUBQUERY despite no free variablesBaron Schwartz25 Feb