MySQL Forums
Forum List  »  Optimizer & Parser

Optimizer - subqueries
Posted by: Jake Day
Date: November 01, 2005 09:59AM

Hi,

Can anyone advise if its possible to force the optimizer to perform subqueries before the "outer" query.

I've got a few queries that should run and complete in less than 45 seconds, but are being "killed" after 10 mins+.

The explain shows that the query is running the "outer" part first, and then the subquery. I want it to run the subquery first.

For example,

Select * from header a, detail b where a.id = b.id
and a.id in (select id from c)

c is a "daily" table, so only has a subset of data on it. But the optimizer insists on doing the a/b match first, rather than doing the subselect?

If anyone can advise how to get the subquery to run first it would be most apppreciated.

Thanks

jake

Options: ReplyQuote


Subject
Views
Written By
Posted
Optimizer - subqueries
4337
November 01, 2005 09:59AM
2356
November 02, 2005 03:52AM
2250
November 02, 2005 08:50AM


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.