All Forums Database
Kks 128 posts Joined 03/06
18 Dec 2008
Explain Plan : 1=1 join meaning

Hi,I have seen explain plain where join of 1=1 is mentioned can you tell what it means

dnoeth 4628 posts Joined 11/04
19 Dec 2008

This is a dummy join condition, usually for a product join as a result of an unconstraint cross-join within your SQL statement.Dieter

Dieter

05 May 2015

Hi,

I am not seeing any difference in explain plan if we add 1=1, would you please explain when it gives any sort of benefit. Thanks & Regards,

VandeBergB 182 posts Joined 09/06
05 May 2015

Dieter's previous answer still holds, 1=1 will always evaluate to true, thus a dummy join condition inserted as the result of an unconstrained full outer join (cross-join)
Cheers

Some drink from the fountain of knowledge, others just gargle.

05 May 2015

Hi ,
 
I meant benefit as in performance or any scenario where it will add any value, I executed a query with 1=1 and without haven't notice any change in explain plan,  obviously this is always going to be true :)
 
Kind Regards,

You must sign in to leave a comment.