MySQL Forums
Forum List  »  Performance

Re: slow Subquery
Posted by: Oleksandr Byelkin
Date: November 14, 2004 01:23AM

yes, for now IN subqueries is rewriting via EXISTS-like ones. You can see real executed subquery if issue following sequences of commands:
EXPLAIN EXTENDED <your select query>;
SHOW WARNINGS;

situation will be beter if you have index on L.LARGE because direct index lookup function will be used in IN subquery. But if LARGE is really large it do not help much. We plan optimisation of IN but as far you need result now, You'd better rewrite it with JOIN:

select SMALL.* from SMALL left join LARGE on (L=S) where L.L is not null

and test all 3 variants, then coose fastest one.

Options: ReplyQuote


Subject
Views
Written By
Posted
3498
November 12, 2004 12:32AM
2225
November 12, 2004 12:55AM
2388
November 12, 2004 01:19AM
2491
November 13, 2004 12:00AM
Re: slow Subquery
2760
November 14, 2004 01:23AM


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.