>>SELECTONE.ID,TWO.VAL,THREE.ID,THREE.VAL,FOUR.IDFROMPUBLIC.ONE/* PUBLIC.ONE.tableScan */INNERJOINPUBLIC.TWO/* PUBLIC.PRIMARY_KEY_14: ID = PUBLIC.ONE.ID AND ID = PUBLIC.ONE.ID */ON1=1/* WHERE PUBLIC.ONE.ID = PUBLIC.TWO.ID */LEFTOUTERJOINPUBLIC.TWOTHREE/* PUBLIC.PRIMARY_KEY_14: ID = ONE.ID */ONONE.ID=THREE.IDLEFTOUTERJOINPUBLIC.ONEFOUR/* PUBLIC.PRIMARY_KEY_1: ID = TWO.ID */ONTWO.ID=FOUR.IDWHERE(PUBLIC.ONE.ID=PUBLIC.TWO.ID)AND((THREE.VALISNULL)OR(THREE.VAL>=DATE'2006-07-01'))
#+mvStore#>>SELECTONE.ID,TWO.VAL,THREE.ID,THREE.VAL,FOUR.IDFROMPUBLIC.ONE/* PUBLIC.ONE.tableScan */INNERJOINPUBLIC.TWO/* PUBLIC.PRIMARY_KEY_14: ID = PUBLIC.ONE.ID AND ID = PUBLIC.ONE.ID */ON1=1/* WHERE PUBLIC.ONE.ID = PUBLIC.TWO.ID */LEFTOUTERJOINPUBLIC.TWOTHREE/* PUBLIC.PRIMARY_KEY_14: ID = ONE.ID */ONONE.ID=THREE.IDLEFTOUTERJOINPUBLIC.ONEFOUR/* PUBLIC.PRIMARY_KEY_1: ID = TWO.ID */ONTWO.ID=FOUR.IDWHERE(PUBLIC.ONE.ID=PUBLIC.TWO.ID)AND((THREE.VALISNULL)OR(THREE.VAL>=DATE'2006-07-01'))
#-mvStore#>>SELECTONE.ID,TWO.VAL,THREE.ID,THREE.VAL,FOUR.IDFROMPUBLIC.ONE/* PUBLIC.PRIMARY_KEY_1 */INNERJOINPUBLIC.TWO/* PUBLIC.PRIMARY_KEY_14: ID = PUBLIC.ONE.ID AND ID = PUBLIC.ONE.ID */ON1=1/* WHERE PUBLIC.ONE.ID = PUBLIC.TWO.ID */LEFTOUTERJOINPUBLIC.TWOTHREE/* PUBLIC.PRIMARY_KEY_14: ID = ONE.ID */ONONE.ID=THREE.IDLEFTOUTERJOINPUBLIC.ONEFOUR/* PUBLIC.PRIMARY_KEY_1: ID = TWO.ID */ONTWO.ID=FOUR.IDWHERE(PUBLIC.ONE.ID=PUBLIC.TWO.ID)AND((THREE.VALISNULL)OR(THREE.VAL>=DATE'2006-07-01'))
-- Query #4: same as #3, but the joins have been manually re-ordered
-- Correct result set, same as expected for #3.
...
...
@@ -254,7 +255,7 @@ inner join test2 on test1.id=test2.id left
outerjointest3ontest2.id=test3.id
wheretest3.idisnull;
#+mvStore#>>SELECTTEST1.ID,TEST2.ID,TEST3.IDFROMPUBLIC.TEST2/* PUBLIC.TEST2.tableScan */LEFTOUTERJOINPUBLIC.TEST3/* PUBLIC.PRIMARY_KEY_4C0: ID = TEST2.ID */ONTEST2.ID=TEST3.IDINNERJOINPUBLIC.TEST1/* PUBLIC.PRIMARY_KEY_4: ID = TEST2.ID */ON1=1WHERE(TEST3.IDISNULL)AND(TEST1.ID=TEST2.ID)
#-mvStore#>>SELECTTEST1.ID,TEST2.ID,TEST3.IDFROMPUBLIC.TEST1/* PUBLIC.TEST1.tableScan */INNERJOINPUBLIC.TEST2/* PUBLIC.PRIMARY_KEY_4C: ID = TEST1.ID AND ID = TEST1.ID */ON1=1/* WHERE TEST1.ID = TEST2.ID */LEFTOUTERJOINPUBLIC.TEST3/* PUBLIC.PRIMARY_KEY_4C0: ID = TEST2.ID */ONTEST2.ID=TEST3.IDWHERE(TEST3.IDISNULL)AND(TEST1.ID=TEST2.ID)
#-mvStore#>>SELECTTEST1.ID,TEST2.ID,TEST3.IDFROMPUBLIC.TEST1/* PUBLIC.PRIMARY_KEY_4 */INNERJOINPUBLIC.TEST2/* PUBLIC.PRIMARY_KEY_4C: ID = TEST1.ID AND ID = TEST1.ID */ON1=1/* WHERE TEST1.ID = TEST2.ID */LEFTOUTERJOINPUBLIC.TEST3/* PUBLIC.PRIMARY_KEY_4C0: ID = TEST2.ID */ONTEST2.ID=TEST3.IDWHERE(TEST3.IDISNULL)AND(TEST1.ID=TEST2.ID)
insertintotest1selectxfromsystem_range(2,1000);
>updatecount:999
...
...
@@ -271,7 +272,8 @@ explain select * from test1
innerjointest2ontest1.id=test2.id
leftouterjointest3ontest2.id=test3.id
wheretest3.idisnull;
>>SELECTTEST1.ID,TEST2.ID,TEST3.IDFROMPUBLIC.TEST2/* PUBLIC.TEST2.tableScan */LEFTOUTERJOINPUBLIC.TEST3/* PUBLIC.PRIMARY_KEY_4C0: ID = TEST2.ID */ONTEST2.ID=TEST3.IDINNERJOINPUBLIC.TEST1/* PUBLIC.PRIMARY_KEY_4: ID = TEST2.ID */ON1=1WHERE(TEST3.IDISNULL)AND(TEST1.ID=TEST2.ID)
#+mvStore#>>SELECTTEST1.ID,TEST2.ID,TEST3.IDFROMPUBLIC.TEST2/* PUBLIC.TEST2.tableScan */LEFTOUTERJOINPUBLIC.TEST3/* PUBLIC.PRIMARY_KEY_4C0: ID = TEST2.ID */ONTEST2.ID=TEST3.IDINNERJOINPUBLIC.TEST1/* PUBLIC.PRIMARY_KEY_4: ID = TEST2.ID */ON1=1WHERE(TEST3.IDISNULL)AND(TEST1.ID=TEST2.ID)
#-mvStore#>>SELECTTEST1.ID,TEST2.ID,TEST3.IDFROMPUBLIC.TEST2/* PUBLIC.PRIMARY_KEY_4C */LEFTOUTERJOINPUBLIC.TEST3/* PUBLIC.PRIMARY_KEY_4C0: ID = TEST2.ID */ONTEST2.ID=TEST3.IDINNERJOINPUBLIC.TEST1/* PUBLIC.PRIMARY_KEY_4: ID = TEST2.ID */ON1=1WHERE(TEST3.IDISNULL)AND(TEST1.ID=TEST2.ID)