@@ -65,34 +65,36 @@ INSERT INTO emps (empid, deptno, name, salary, commission) VALUES
6565
6666!update
6767
68- SELECT * , EXISTS(select * from (
68+ SELECT empid , EXISTS(select * from (
6969 SELECT e2.deptno FROM emps e2 where e1.commission = e2.commission) as table3
7070 where table3.deptno <> e1.deptno)
7171from emps e1 order by empid;
72- +-------+--------+-----------+----------+------------+--------+
73- | EMPID | DEPTNO | NAME | SALARY | COMMISSION | EXPR$5 |
74- +-------+--------+-----------+----------+------------+--------+
75- | 100 | 10 | Bill | 10000.00 | 1000 | false |
76- | 110 | 10 | Theodore | 11500.00 | 250 | true |
77- | 140 | 10 | Sebastian | 7000.00 | | false |
78- | 150 | 10 | Sebastian | 7000.00 | | false |
79- | 170 | 30 | Theodore | 11500.00 | 250 | true |
80- | 200 | 20 | Eric | 8000.00 | 500 | false |
81- +-------+--------+-----------+----------+------------+--------+
72+ +-------+--------+
73+ | EMPID | EXPR$1 |
74+ +-------+--------+
75+ | 100 | false |
76+ | 110 | true |
77+ | 140 | false |
78+ | 150 | false |
79+ | 170 | true |
80+ | 200 | false |
81+ +-------+--------+
8282(6 rows)
8383
8484!ok
8585
8686!if (use_new_decorr) {
8787EnumerableSort(sort0=[$0], dir0=[ASC])
88- EnumerableHashJoin(condition=[AND(IS NOT DISTINCT FROM($1, $6), IS NOT DISTINCT FROM($4, $7))], joinType=[left_mark])
89- EnumerableTableScan(table=[[BLANK, EMPS]])
90- EnumerableCalc(expr#0..3=[{inputs}], DEPTNO=[$t2], DEPTNO0=[$t0], COMMISSION0=[$t1])
91- EnumerableHashJoin(condition=[AND(=($1, $3), <>($2, $0))], joinType=[inner])
92- EnumerableAggregate(group=[{1, 4}])
93- EnumerableTableScan(table=[[BLANK, EMPS]])
94- EnumerableCalc(expr#0..4=[{inputs}], DEPTNO=[$t1], COMMISSION=[$t4])
95- EnumerableTableScan(table=[[BLANK, EMPS]])
88+ EnumerableCalc(expr#0..3=[{inputs}], EMPID=[$t0], EXPR$1=[$t3])
89+ EnumerableHashJoin(condition=[AND(IS NOT DISTINCT FROM($1, $3), IS NOT DISTINCT FROM($2, $4))], joinType=[left_mark])
90+ EnumerableCalc(expr#0..4=[{inputs}], proj#0..1=[{exprs}], COMMISSION=[$t4])
91+ EnumerableTableScan(table=[[BLANK, EMPS]])
92+ EnumerableCalc(expr#0..3=[{inputs}], proj#0..1=[{exprs}])
93+ EnumerableHashJoin(condition=[AND(=($1, $3), <>($2, $0))], joinType=[inner])
94+ EnumerableAggregate(group=[{1, 4}])
95+ EnumerableTableScan(table=[[BLANK, EMPS]])
96+ EnumerableCalc(expr#0..4=[{inputs}], DEPTNO=[$t1], COMMISSION=[$t4])
97+ EnumerableTableScan(table=[[BLANK, EMPS]])
9698!plan
9799!}
98100
0 commit comments