Commit df3ff5f
committed
Correct comments in convert_IN_to_antijoin()
Incorrect example comments:
The transformation is to rewrite a query of the form:
select c1 from t1 where c1 NOT IN (select c2 from t2);
(to)
select c1 from t1 left anti semi join (select 0 as zero, c2 from t2) foo
ON (c1 = c2) IS NOT FALSE where zero is NULL;
Correct it to:
The transformation is to rewrite a query of the form:
select c1 from t1 where c1 NOT IN (select c2 from t2);
(to)
select c1 from t1 left anti semi join (select 0 as zero, c2 from t2) foo
ON (c1 != c2) IS NOT FALSE where zero is NULL;
SQL NOT IN should be converted to Left Anti Semi (not-in) Join
with join condition c1 != c2.
Any non-null values from t1 don't match values from t2 shoule be kept and
IS NOT FALSE will return TRUE.
GDB checks after function make_lasj_quals()
join_expr->quals:
BoolExpr [boolop=NOT_EXPR]
OpExpr [opno=518 opfuncid=144 opresulttype=16 opretset=false]
Var [varno=1 varattno=1 vartype=23 varnoold=1 varoattno=1]
Var [varno=2 varattno=1 vartype=23 varnoold=2 varoattno=1]
And oid 518 is a '<>' operator in pg_operator.
select oprname from pg_operator where oid = 518;
-[ RECORD 1 ]
oprname | <>
Authored-by: Zhang Mingli avamingli@gmail.com1 parent 3a89357 commit df3ff5f
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1455 | 1455 | | |
1456 | 1456 | | |
1457 | 1457 | | |
1458 | | - | |
| 1458 | + | |
1459 | 1459 | | |
1460 | 1460 | | |
1461 | 1461 | | |
| |||
0 commit comments