Hi, ----- Original Message ----- From: "Jeremy Zawodny" Cc: <[EMAIL PROTECTED]> Sent: Friday, September 19, 2003 5:12 PM Subject: Re: explain
> On Fri, Sep 19, 2003 at 02:12:02PM -0700, Hsiu-Hui Tseng wrote: > > Hello, > > > > When I do a explain on a query, I got the following: > > +-----------------------------------------------------+ > > | Comment | > > +-----------------------------------------------------+ > > | Impossible WHERE noticed after reading const tables | > > +-----------------------------------------------------+ > > > > does this say that my query is using Primary key? > > It says that MySQL doesn't believe the query you've asked makes > sense. If the query didn't "make sense" such as if the WHERE contained 1=0, it would just say "Impossible WHERE." The additional "noticed after reading const tables" is just that; an impossible WHERE detected after reading the const tables (<= 1 row or where the WHERE refers all parts of a unique key with constant values). So yes, to answer the original question, it is using the PRIMARY KEY (or a UNIQUE one) or the table has less than 2 rows. Since only a single key lookup is needed, it can quickly tell if there's a matching row or not. If there is a matching row, EXPLAIN will output the usual columns of information. Matt -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]