MySQL Forums
Forum List  »  General

Slow query with subquery
Posted by: Kai Hencke
Date: February 03, 2014 07:17AM

Hi,

i am using a mysql query like:

select ...
from ...
where ... AND xxx in (select ... from ... where ...)

and this query takes more than a day to get a result.

But when I first run the subquery and after that I use the result of the subquery directly like:
select ...
from ...
where ... and "result of the subquery"

Then I get the result really fast.

Is there a way to do that automatically ?
Like to force evaluation of the subquery first and after that the main query ?

Options: ReplyQuote


Subject
Written By
Posted
Slow query with subquery
February 03, 2014 07:17AM
February 03, 2014 08:24PM


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.