DBA wrote:

----- Original Message ----- From: "Kevin Burton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <mysql@lists.mysql.com>
Sent: Tuesday, June 07, 2005 6:11 PM
Subject: Re: Seriously.. When are we going to get subqueries?!


Greg Whalin wrote:

They do use indexes if you use them to build derived tables and are pretty fast. The only case where I see them not using indexes when I think they should is when you use a sub-query for an IN() clause.
I'm sorry.. yes.. They're not using indexes when within IN clauses which for me is 99.9% of the time.

Maybe I'm wrong though and this is a rare but I don't think so...

Kevin

I use subqueries and I thought that it was using the index? I might be wrong? 
This is MySQL on 4.1.11-nt. Here is the explain plan:

Nope... its a bit confusing but no... it's not. The subquery ITSELF is using queries but the parent query which is using your

ptt_trans_06

table is not ...

Notice the Type: ALL and Key: NULL

Luckly though you only have 21k rows so its not that big of a deal.

KEvin

--


Use Rojo (RSS/Atom aggregator)! - visit http://rojo.com. See irc.freenode.net #rojo if you want to chat.

Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html

  Kevin A. Burton, Location - San Francisco, CA
     AIM/YIM - sfburtonator,  Web - http://peerfear.org/
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to