MySQL Forums
Forum List  »  Optimizer & Parser

Re: Can't understand why optimizer doesn't work properly :(
Posted by: Sergey Belov
Date: July 24, 2007 02:42AM

The original query

SELECT * FROM Messages WHERE Messages.Ask IN (SELECT Ask.Ask FROM Ask WHERE Ask.DateTime<20070710)

was rewritten by documentation:

SELECT * FROM Messages WHERE EXISTS (SELECT 1 FROM Ask WHERE Ask.Ask = Messages.Ask AND Ask.DateTime<20070710)

The `Ask` table has much less rows than the `Messages` table. And there is condition in select `Ask` table. So, the rows count in select will be even less.

How can I tell optimizer, that it should first select subquery an than select outer query? I can't use JOIN syntax, because this select is a part of Insert construction.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Can't understand why optimizer doesn't work properly :(
2359
July 24, 2007 02:42AM


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.