MySQL Forums
Forum List  »  Optimizer & Parser

Re: Subqueries too slow
Posted by: Jay Pipes
Date: February 06, 2006 11:54AM

There's no need for subqueries at all. Just use standard joins:

SELECT a.id, a.acc, a.name
FROM a
INNER JOIN b
ON a.id = b.a_id
INNER JOIN c
ON b.c_id=c.id
AND c.acc="X"
INNER JOIN c2
ON b.c_id=c2.id
WHERE c2.acc="Y";

I have, however, reported this to the optimizer team, as they are looking for areas to improve subquery performance... Thanks!

Jay Pipes
Community Relations Manager, North America, MySQL Inc.

Got Cluster? http://www.mysql.com/cluster
Personal: http://jpipes.com

Options: ReplyQuote


Subject
Views
Written By
Posted
5015
February 06, 2006 11:08AM
Re: Subqueries too slow
2528
February 06, 2006 11:54AM
2329
February 06, 2006 02:17PM
2302
February 07, 2006 07:06AM
2319
February 07, 2006 08:38AM
2346
February 10, 2006 03:18AM
2012
February 10, 2006 08:51AM
2081
February 10, 2006 09:49AM
2228
February 10, 2006 10:43AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.