MySQL Forums
Forum List  »  Optimizer & Parser

Re: SQL Newbie needs urgently help! [optimizing query]
Posted by: Toa Sty
Date: January 24, 2007 10:29AM

Ah I seem to have lost my reply to this. (thought I'd posted it but I can't see it here)

So, quickly:
* I must admit I'm not sure why the second query plan is better - it looks worse to me.
* Have you tried extracting the subquery to see if you can optimise it on its own as a way to simplify the problem ? (replacing references to the outer select with constants and compare various execution plans)

I'm not sure whether the subquery is being strangely optimised or whether it's some interplay with the EXISTS clause that I'm not familiar with.


Sorry I can't help more - it's hard without being able to test/play with the query.

Hopefully with all the info you've posted someone will be able to suggest something!

Toasty

PS have you run analyze table on these tables recently? We could be trying to optimise something that doesn't need it...

-----------------------------------------
email: 'toasty'*3 at gmail

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: SQL Newbie needs urgently help! [optimizing query]
2470
January 24, 2007 10:29AM


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.