Re: Optimization question: Unrolling subquery into IN clause
From: Wolfram Roesler <wr_at_spam.la>
Date: Fri, 16 Oct 2009 12:33:02 +0000 (UTC)
Message-ID: <Xns9CA694047A75Ewrgrpde_at_news.albasani.net>
Jeff <dontspam_at_home.nl> wrote in
news:MPG.25426c2cfedbb1b498968b_at_textnews.eweka.nl:
Date: Fri, 16 Oct 2009 12:33:02 +0000 (UTC)
Message-ID: <Xns9CA694047A75Ewrgrpde_at_news.albasani.net>
Jeff <dontspam_at_home.nl> wrote in
news:MPG.25426c2cfedbb1b498968b_at_textnews.eweka.nl:
> Have you tried rewriting to:
>
> SELECT several_columns
> FROM tab1
> WHERE col1='Value'
> AND EXISTS
> (
> SELECT key
> FROM tab2
> WHERE tab2.col3='Something'
> AND tab1.col2=tab2.key
> );
Yes, it made no difference. It looks like Oracle always wants to do the "col1='Value'" part first and join that with the result of the subquery resp. EXISTS later.
Thanks anyway
W. Rösler
Received on Fri Oct 16 2009 - 07:33:02 CDT