Changeset: 0ac3b2ee5dcb for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0ac3b2ee5dcb
Modified Files:
        sql/backends/monet5/rel_bin.c
        sql/benchmarks/ssbm/Tests/01-plan.stable.out
        sql/benchmarks/ssbm/Tests/02-plan.stable.out
        sql/benchmarks/ssbm/Tests/03-plan.stable.out
        sql/benchmarks/ssbm/Tests/11-plan.stable.out
        sql/benchmarks/ssbm/Tests/12-plan.stable.out
        sql/benchmarks/ssbm/Tests/13-plan.stable.out
        sql/benchmarks/tpch/Tests/01-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/01-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/03-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/05-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/06-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/07-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/08-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/08-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/09-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/10-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/11-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/12-explain.stable.out
        sql/benchmarks/tpch/Tests/12-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/12-plan.stable.out
        sql/benchmarks/tpch/Tests/14-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/14-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/19-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/22-plan.stable.out
        sql/include/sql_relation.h
        sql/server/rel_exp.c
        sql/server/rel_exp.h
        sql/server/rel_optimizer.c
        sql/server/sql_atom.c
        
sql/test/BugTracker-2009/Tests/segfault_when_quitting_debugger.SF-2538837.stable.out
        
sql/test/BugTracker-2016/Tests/memory-consumption-query-PLAN-25joins.Bug-3972.stable.out
        sql/test/mergetables/Tests/part-elim.sql
        sql/test/mergetables/Tests/part-elim.stable.out
Branch: default
Log Message:

partition all expressions in a project (and find common expressions)


diffs (truncated from 1833 to 300 lines):

diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -419,6 +419,7 @@ exp_bin(mvc *sql, sql_exp *e, stmt *left
                        stmt *orderby = NULL;
                        stmt *col = NULL;
                
+                       assert(0);
                        if (exps) {
                                for (en = exps->h; en; en = en->next) {
                                        stmt *es;
diff --git a/sql/benchmarks/ssbm/Tests/01-plan.stable.out 
b/sql/benchmarks/ssbm/Tests/01-plan.stable.out
--- a/sql/benchmarks/ssbm/Tests/01-plan.stable.out
+++ b/sql/benchmarks/ssbm/Tests/01-plan.stable.out
@@ -35,18 +35,20 @@ Ready.
 % .plan # table_name
 % rel # name
 % clob # type
-% 211 # length
+% 213 # length
 project (
 | group by (
-| | join (
-| | | select (
-| | | | table(sys.lineorder) [ lineorder.lo_quantity, 
lineorder.lo_extendedprice, lineorder.lo_discount, 
lineorder.%lineorder_lo_orderdate_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_orderdate_fkey ] COUNT 
-| | | ) [ int "1" <= lineorder.lo_discount <= int "3", lineorder.lo_quantity < 
int "25" ],
-| | | select (
-| | | | table(sys.dwdate) [ dwdate.d_year, dwdate.%TID% NOT NULL ] COUNT 
-| | | ) [ dwdate.d_year = int "1993" ]
-| | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ]
-| ) [  ] [ sys.sum no nil (sys.sql_mul(bigint[lineorder.lo_extendedprice] as 
lineorder.lo_extendedprice, lineorder.lo_discount)) as L1.L1 ]
+| | project (
+| | | join (
+| | | | select (
+| | | | | table(sys.lineorder) [ lineorder.lo_quantity, 
lineorder.lo_extendedprice, lineorder.lo_discount, 
lineorder.%lineorder_lo_orderdate_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_orderdate_fkey ] COUNT 
+| | | | ) [ int "1" <= lineorder.lo_discount <= int "3", lineorder.lo_quantity 
< int "25" ],
+| | | | select (
+| | | | | table(sys.dwdate) [ dwdate.d_year, dwdate.%TID% NOT NULL ] COUNT 
+| | | | ) [ dwdate.d_year = int "1993" ]
+| | | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ]
+| | ) [ lineorder.lo_extendedprice, lineorder.lo_discount, 
bigint[lineorder.lo_extendedprice] as L2.L2, sys.sql_mul(L2.L2, 
lineorder.lo_discount) as L3.L3 ]
+| ) [  ] [ sys.sum no nil (L3.L3) as L1.L1 ]
 ) [ L1 as L1.revenue ]
 
 # 23:08:56 >  
diff --git a/sql/benchmarks/ssbm/Tests/02-plan.stable.out 
b/sql/benchmarks/ssbm/Tests/02-plan.stable.out
--- a/sql/benchmarks/ssbm/Tests/02-plan.stable.out
+++ b/sql/benchmarks/ssbm/Tests/02-plan.stable.out
@@ -35,18 +35,20 @@ Ready.
 % .plan # table_name
 % rel # name
 % clob # type
-% 211 # length
+% 213 # length
 project (
 | group by (
-| | join (
-| | | select (
-| | | | table(sys.lineorder) [ lineorder.lo_quantity, 
lineorder.lo_extendedprice, lineorder.lo_discount, 
lineorder.%lineorder_lo_orderdate_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_orderdate_fkey ] COUNT 
-| | | ) [ int "4" <= lineorder.lo_discount <= int "6", int "26" <= 
lineorder.lo_quantity <= int "35" ],
-| | | select (
-| | | | table(sys.dwdate) [ dwdate.d_yearmonthnum, dwdate.%TID% NOT NULL ] 
COUNT 
-| | | ) [ dwdate.d_yearmonthnum = int "199401" ]
-| | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ]
-| ) [  ] [ sys.sum no nil (sys.sql_mul(bigint[lineorder.lo_extendedprice] as 
lineorder.lo_extendedprice, lineorder.lo_discount)) as L1.L1 ]
+| | project (
+| | | join (
+| | | | select (
+| | | | | table(sys.lineorder) [ lineorder.lo_quantity, 
lineorder.lo_extendedprice, lineorder.lo_discount, 
lineorder.%lineorder_lo_orderdate_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_orderdate_fkey ] COUNT 
+| | | | ) [ int "4" <= lineorder.lo_discount <= int "6", int "26" <= 
lineorder.lo_quantity <= int "35" ],
+| | | | select (
+| | | | | table(sys.dwdate) [ dwdate.d_yearmonthnum, dwdate.%TID% NOT NULL ] 
COUNT 
+| | | | ) [ dwdate.d_yearmonthnum = int "199401" ]
+| | | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ]
+| | ) [ lineorder.lo_extendedprice, lineorder.lo_discount, 
bigint[lineorder.lo_extendedprice] as L2.L2, sys.sql_mul(L2.L2, 
lineorder.lo_discount) as L3.L3 ]
+| ) [  ] [ sys.sum no nil (L3.L3) as L1.L1 ]
 ) [ L1 as L1.revenue ]
 
 # 23:08:56 >  
diff --git a/sql/benchmarks/ssbm/Tests/03-plan.stable.out 
b/sql/benchmarks/ssbm/Tests/03-plan.stable.out
--- a/sql/benchmarks/ssbm/Tests/03-plan.stable.out
+++ b/sql/benchmarks/ssbm/Tests/03-plan.stable.out
@@ -35,18 +35,20 @@ Ready.
 % .plan # table_name
 % rel # name
 % clob # type
-% 211 # length
+% 213 # length
 project (
 | group by (
-| | join (
-| | | select (
-| | | | table(sys.lineorder) [ lineorder.lo_quantity, 
lineorder.lo_extendedprice, lineorder.lo_discount, 
lineorder.%lineorder_lo_orderdate_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_orderdate_fkey ] COUNT 
-| | | ) [ int "5" <= lineorder.lo_discount <= int "7", int "36" <= 
lineorder.lo_quantity <= int "40" ],
-| | | select (
-| | | | table(sys.dwdate) [ dwdate.d_year, dwdate.d_weeknuminyear, 
dwdate.%TID% NOT NULL ] COUNT 
-| | | ) [ dwdate.d_year = int "1994", dwdate.d_weeknuminyear = int "6" ]
-| | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ]
-| ) [  ] [ sys.sum no nil (sys.sql_mul(bigint[lineorder.lo_extendedprice] as 
lineorder.lo_extendedprice, lineorder.lo_discount)) as L1.L1 ]
+| | project (
+| | | join (
+| | | | select (
+| | | | | table(sys.lineorder) [ lineorder.lo_quantity, 
lineorder.lo_extendedprice, lineorder.lo_discount, 
lineorder.%lineorder_lo_orderdate_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_orderdate_fkey ] COUNT 
+| | | | ) [ int "5" <= lineorder.lo_discount <= int "7", int "36" <= 
lineorder.lo_quantity <= int "40" ],
+| | | | select (
+| | | | | table(sys.dwdate) [ dwdate.d_year, dwdate.d_weeknuminyear, 
dwdate.%TID% NOT NULL ] COUNT 
+| | | | ) [ dwdate.d_year = int "1994", dwdate.d_weeknuminyear = int "6" ]
+| | | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ]
+| | ) [ lineorder.lo_extendedprice, lineorder.lo_discount, 
bigint[lineorder.lo_extendedprice] as L2.L2, sys.sql_mul(L2.L2, 
lineorder.lo_discount) as L3.L3 ]
+| ) [  ] [ sys.sum no nil (L3.L3) as L1.L1 ]
 ) [ L1 as L1.revenue ]
 
 # 23:08:57 >  
diff --git a/sql/benchmarks/ssbm/Tests/11-plan.stable.out 
b/sql/benchmarks/ssbm/Tests/11-plan.stable.out
--- a/sql/benchmarks/ssbm/Tests/11-plan.stable.out
+++ b/sql/benchmarks/ssbm/Tests/11-plan.stable.out
@@ -40,29 +40,31 @@ Ready.
 % .plan # table_name
 % rel # name
 % clob # type
-% 474 # length
+% 476 # length
 project (
 | group by (
-| | join (
+| | project (
 | | | join (
 | | | | join (
 | | | | | join (
-| | | | | | table(sys.lineorder) [ lineorder.lo_revenue, 
lineorder.lo_supplycost, lineorder.%lineorder_lo_orderdate_fkey NOT NULL 
JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey, 
lineorder.%lineorder_lo_suppkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_suppkey_fkey, lineorder.%lineorder_lo_custkey_fkey 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey, 
lineorder.%lineorder_lo_partkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_partkey_fkey ] COUNT ,
+| | | | | | join (
+| | | | | | | table(sys.lineorder) [ lineorder.lo_revenue, 
lineorder.lo_supplycost, lineorder.%lineorder_lo_orderdate_fkey NOT NULL 
JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey, 
lineorder.%lineorder_lo_suppkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_suppkey_fkey, lineorder.%lineorder_lo_custkey_fkey 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey, 
lineorder.%lineorder_lo_partkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_partkey_fkey ] COUNT ,
+| | | | | | | select (
+| | | | | | | | table(sys.part) [ part.p_mfgr, part.%TID% NOT NULL ] COUNT 
+| | | | | | | ) [ part.p_mfgr in (clob "MFGR#1", clob "MFGR#2") ]
+| | | | | | ) [ lineorder.%lineorder_lo_partkey_fkey NOT NULL = part.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_partkey_fkey ],
 | | | | | | select (
-| | | | | | | table(sys.part) [ part.p_mfgr, part.%TID% NOT NULL ] COUNT 
-| | | | | | ) [ part.p_mfgr in (clob "MFGR#1", clob "MFGR#2") ]
-| | | | | ) [ lineorder.%lineorder_lo_partkey_fkey NOT NULL = part.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_partkey_fkey ],
+| | | | | | | table(sys.supplier) [ supplier.s_region, supplier.%TID% NOT NULL 
] COUNT 
+| | | | | | ) [ supplier.s_region = clob "AMERICA" ]
+| | | | | ) [ lineorder.%lineorder_lo_suppkey_fkey NOT NULL = supplier.%TID% 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_suppkey_fkey ],
 | | | | | select (
-| | | | | | table(sys.supplier) [ supplier.s_region, supplier.%TID% NOT NULL ] 
COUNT 
-| | | | | ) [ supplier.s_region = clob "AMERICA" ]
-| | | | ) [ lineorder.%lineorder_lo_suppkey_fkey NOT NULL = supplier.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_suppkey_fkey ],
-| | | | select (
-| | | | | table(sys.customer) [ customer.c_nation, customer.c_region, 
customer.%TID% NOT NULL ] COUNT 
-| | | | ) [ customer.c_region = clob "AMERICA" ]
-| | | ) [ lineorder.%lineorder_lo_custkey_fkey NOT NULL = customer.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey ],
-| | | table(sys.dwdate) [ dwdate.d_year, dwdate.%TID% NOT NULL ] COUNT 
-| | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ]
-| ) [ dwdate.d_year, customer.c_nation ] [ dwdate.d_year, customer.c_nation, 
sys.sum no nil (sys.sql_sub(bigint[lineorder.lo_revenue] as 
lineorder.lo_revenue, bigint[lineorder.lo_supplycost] as 
lineorder.lo_supplycost)) as L1.L1 ]
+| | | | | | table(sys.customer) [ customer.c_nation, customer.c_region, 
customer.%TID% NOT NULL ] COUNT 
+| | | | | ) [ customer.c_region = clob "AMERICA" ]
+| | | | ) [ lineorder.%lineorder_lo_custkey_fkey NOT NULL = customer.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey ],
+| | | | table(sys.dwdate) [ dwdate.d_year, dwdate.%TID% NOT NULL ] COUNT 
+| | | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ]
+| | ) [ dwdate.d_year, customer.c_nation, lineorder.lo_revenue, 
lineorder.lo_supplycost, bigint[lineorder.lo_revenue] as L2.L2, 
bigint[lineorder.lo_supplycost] as L3.L3, sys.sql_sub(L2.L2, L3.L3) as L4.L4 ]
+| ) [ dwdate.d_year, customer.c_nation ] [ dwdate.d_year, customer.c_nation, 
sys.sum no nil (L4.L4) as L1.L1 ]
 ) [ dwdate.d_year, customer.c_nation, L1 as L1.profit1 ] [ dwdate.d_year ASC, 
customer.c_nation ASC ]
 
 # 23:08:59 >  
diff --git a/sql/benchmarks/ssbm/Tests/12-plan.stable.out 
b/sql/benchmarks/ssbm/Tests/12-plan.stable.out
--- a/sql/benchmarks/ssbm/Tests/12-plan.stable.out
+++ b/sql/benchmarks/ssbm/Tests/12-plan.stable.out
@@ -41,31 +41,33 @@ Ready.
 % .plan # table_name
 % rel # name
 % clob # type
-% 474 # length
+% 476 # length
 project (
 | group by (
-| | join (
+| | project (
 | | | join (
 | | | | join (
 | | | | | join (
-| | | | | | table(sys.lineorder) [ lineorder.lo_revenue, 
lineorder.lo_supplycost, lineorder.%lineorder_lo_orderdate_fkey NOT NULL 
JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey, 
lineorder.%lineorder_lo_suppkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_suppkey_fkey, lineorder.%lineorder_lo_custkey_fkey 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey, 
lineorder.%lineorder_lo_partkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_partkey_fkey ] COUNT ,
+| | | | | | join (
+| | | | | | | table(sys.lineorder) [ lineorder.lo_revenue, 
lineorder.lo_supplycost, lineorder.%lineorder_lo_orderdate_fkey NOT NULL 
JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey, 
lineorder.%lineorder_lo_suppkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_suppkey_fkey, lineorder.%lineorder_lo_custkey_fkey 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey, 
lineorder.%lineorder_lo_partkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_partkey_fkey ] COUNT ,
+| | | | | | | select (
+| | | | | | | | table(sys.dwdate) [ dwdate.d_year, dwdate.%TID% NOT NULL ] 
COUNT 
+| | | | | | | ) [ dwdate.d_year in (int "1997", int "1998") ]
+| | | | | | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ],
 | | | | | | select (
-| | | | | | | table(sys.dwdate) [ dwdate.d_year, dwdate.%TID% NOT NULL ] COUNT 
-| | | | | | ) [ dwdate.d_year in (int "1997", int "1998") ]
-| | | | | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ],
+| | | | | | | table(sys.part) [ part.p_mfgr, part.p_category, part.%TID% NOT 
NULL ] COUNT 
+| | | | | | ) [ part.p_mfgr in (clob "MFGR#1", clob "MFGR#2") ]
+| | | | | ) [ lineorder.%lineorder_lo_partkey_fkey NOT NULL = part.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_partkey_fkey ],
 | | | | | select (
-| | | | | | table(sys.part) [ part.p_mfgr, part.p_category, part.%TID% NOT 
NULL ] COUNT 
-| | | | | ) [ part.p_mfgr in (clob "MFGR#1", clob "MFGR#2") ]
-| | | | ) [ lineorder.%lineorder_lo_partkey_fkey NOT NULL = part.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_partkey_fkey ],
+| | | | | | table(sys.supplier) [ supplier.s_nation, supplier.s_region, 
supplier.%TID% NOT NULL ] COUNT 
+| | | | | ) [ supplier.s_region = clob "AMERICA" ]
+| | | | ) [ lineorder.%lineorder_lo_suppkey_fkey NOT NULL = supplier.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_suppkey_fkey ],
 | | | | select (
-| | | | | table(sys.supplier) [ supplier.s_nation, supplier.s_region, 
supplier.%TID% NOT NULL ] COUNT 
-| | | | ) [ supplier.s_region = clob "AMERICA" ]
-| | | ) [ lineorder.%lineorder_lo_suppkey_fkey NOT NULL = supplier.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_suppkey_fkey ],
-| | | select (
-| | | | table(sys.customer) [ customer.c_region, customer.%TID% NOT NULL ] 
COUNT 
-| | | ) [ customer.c_region = clob "AMERICA" ]
-| | ) [ lineorder.%lineorder_lo_custkey_fkey NOT NULL = customer.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey ]
-| ) [ dwdate.d_year, supplier.s_nation, part.p_category ] [ dwdate.d_year, 
supplier.s_nation, part.p_category, sys.sum no nil 
(sys.sql_sub(bigint[lineorder.lo_revenue] as lineorder.lo_revenue, 
bigint[lineorder.lo_supplycost] as lineorder.lo_supplycost)) as L1.L1 ]
+| | | | | table(sys.customer) [ customer.c_region, customer.%TID% NOT NULL ] 
COUNT 
+| | | | ) [ customer.c_region = clob "AMERICA" ]
+| | | ) [ lineorder.%lineorder_lo_custkey_fkey NOT NULL = customer.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey ]
+| | ) [ dwdate.d_year, supplier.s_nation, part.p_category, 
lineorder.lo_revenue, lineorder.lo_supplycost, bigint[lineorder.lo_revenue] as 
L2.L2, bigint[lineorder.lo_supplycost] as L3.L3, sys.sql_sub(L2.L2, L3.L3) as 
L4.L4 ]
+| ) [ dwdate.d_year, supplier.s_nation, part.p_category ] [ dwdate.d_year, 
supplier.s_nation, part.p_category, sys.sum no nil (L4.L4) as L1.L1 ]
 ) [ dwdate.d_year, supplier.s_nation, part.p_category, L1 as L1.profit1 ] [ 
dwdate.d_year ASC, supplier.s_nation ASC, part.p_category ASC ]
 
 # 23:08:59 >  
diff --git a/sql/benchmarks/ssbm/Tests/13-plan.stable.out 
b/sql/benchmarks/ssbm/Tests/13-plan.stable.out
--- a/sql/benchmarks/ssbm/Tests/13-plan.stable.out
+++ b/sql/benchmarks/ssbm/Tests/13-plan.stable.out
@@ -41,31 +41,33 @@ Ready.
 % .plan # table_name
 % rel # name
 % clob # type
-% 474 # length
+% 476 # length
 project (
 | group by (
-| | join (
+| | project (
 | | | join (
 | | | | join (
 | | | | | join (
-| | | | | | table(sys.lineorder) [ lineorder.lo_revenue, 
lineorder.lo_supplycost, lineorder.%lineorder_lo_orderdate_fkey NOT NULL 
JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey, 
lineorder.%lineorder_lo_suppkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_suppkey_fkey, lineorder.%lineorder_lo_custkey_fkey 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey, 
lineorder.%lineorder_lo_partkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_partkey_fkey ] COUNT ,
+| | | | | | join (
+| | | | | | | table(sys.lineorder) [ lineorder.lo_revenue, 
lineorder.lo_supplycost, lineorder.%lineorder_lo_orderdate_fkey NOT NULL 
JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey, 
lineorder.%lineorder_lo_suppkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_suppkey_fkey, lineorder.%lineorder_lo_custkey_fkey 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey, 
lineorder.%lineorder_lo_partkey_fkey NOT NULL JOINIDX 
sys.lineorder.lineorder_lo_partkey_fkey ] COUNT ,
+| | | | | | | select (
+| | | | | | | | table(sys.dwdate) [ dwdate.d_year, dwdate.%TID% NOT NULL ] 
COUNT 
+| | | | | | | ) [ dwdate.d_year in (int "1997", int "1998") ]
+| | | | | | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ],
 | | | | | | select (
-| | | | | | | table(sys.dwdate) [ dwdate.d_year, dwdate.%TID% NOT NULL ] COUNT 
-| | | | | | ) [ dwdate.d_year in (int "1997", int "1998") ]
-| | | | | ) [ lineorder.%lineorder_lo_orderdate_fkey NOT NULL = dwdate.%TID% 
NOT NULL JOINIDX sys.lineorder.lineorder_lo_orderdate_fkey ],
+| | | | | | | table(sys.part) [ part.p_category, part.p_brand1, part.%TID% NOT 
NULL ] COUNT 
+| | | | | | ) [ part.p_category = clob "MFGR#14" ]
+| | | | | ) [ lineorder.%lineorder_lo_partkey_fkey NOT NULL = part.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_partkey_fkey ],
 | | | | | select (
-| | | | | | table(sys.part) [ part.p_category, part.p_brand1, part.%TID% NOT 
NULL ] COUNT 
-| | | | | ) [ part.p_category = clob "MFGR#14" ]
-| | | | ) [ lineorder.%lineorder_lo_partkey_fkey NOT NULL = part.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_partkey_fkey ],
+| | | | | | table(sys.supplier) [ supplier.s_city, supplier.s_nation, 
supplier.%TID% NOT NULL ] COUNT 
+| | | | | ) [ supplier.s_nation = clob "UNITED STATES" ]
+| | | | ) [ lineorder.%lineorder_lo_suppkey_fkey NOT NULL = supplier.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_suppkey_fkey ],
 | | | | select (
-| | | | | table(sys.supplier) [ supplier.s_city, supplier.s_nation, 
supplier.%TID% NOT NULL ] COUNT 
-| | | | ) [ supplier.s_nation = clob "UNITED STATES" ]
-| | | ) [ lineorder.%lineorder_lo_suppkey_fkey NOT NULL = supplier.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_suppkey_fkey ],
-| | | select (
-| | | | table(sys.customer) [ customer.c_region, customer.%TID% NOT NULL ] 
COUNT 
-| | | ) [ customer.c_region = clob "AMERICA" ]
-| | ) [ lineorder.%lineorder_lo_custkey_fkey NOT NULL = customer.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey ]
-| ) [ dwdate.d_year, supplier.s_city, part.p_brand1 ] [ dwdate.d_year, 
supplier.s_city, part.p_brand1, sys.sum no nil 
(sys.sql_sub(bigint[lineorder.lo_revenue] as lineorder.lo_revenue, 
bigint[lineorder.lo_supplycost] as lineorder.lo_supplycost)) as L1.L1 ]
+| | | | | table(sys.customer) [ customer.c_region, customer.%TID% NOT NULL ] 
COUNT 
+| | | | ) [ customer.c_region = clob "AMERICA" ]
+| | | ) [ lineorder.%lineorder_lo_custkey_fkey NOT NULL = customer.%TID% NOT 
NULL JOINIDX sys.lineorder.lineorder_lo_custkey_fkey ]
+| | ) [ dwdate.d_year, supplier.s_city, part.p_brand1, lineorder.lo_revenue, 
lineorder.lo_supplycost, bigint[lineorder.lo_revenue] as L2.L2, 
bigint[lineorder.lo_supplycost] as L3.L3, sys.sql_sub(L2.L2, L3.L3) as L4.L4 ]
+| ) [ dwdate.d_year, supplier.s_city, part.p_brand1 ] [ dwdate.d_year, 
supplier.s_city, part.p_brand1, sys.sum no nil (L4.L4) as L1.L1 ]
 ) [ dwdate.d_year, supplier.s_city, part.p_brand1, L1 as L1.profit1 ] [ 
dwdate.d_year ASC, supplier.s_city ASC, part.p_brand1 ASC ]
 
 # 23:08:59 >  
diff --git a/sql/benchmarks/tpch/Tests/01-explain.stable.out.int128 
b/sql/benchmarks/tpch/Tests/01-explain.stable.out.int128
--- a/sql/benchmarks/tpch/Tests/01-explain.stable.out.int128
+++ b/sql/benchmarks/tpch/Tests/01-explain.stable.out.int128
@@ -52,72 +52,72 @@ Ready.
 % clob # type
 % 607 # length
 function user.s2_1(A0:bte,A1:bte,A2:bte,A3:date,A4:lng):void;
-    X_226:void := querylog.define("explain select\n l_returnflag,\n 
l_linestatus,\n sum(l_quantity) as sum_qty,\n sum(l_extendedprice) as 
sum_base_price,\n sum(l_extendedprice * (1 - l_discount)) as sum_disc_price,\n 
sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge,\n 
avg(l_quantity) as avg_qty,\n avg(l_extendedprice) as avg_price,\n 
avg(l_discount) as avg_disc,\n count(*) as count_order\nfrom\n 
lineitem\nwhere\n l_shipdate <= date \\'1998-12-01\\' - interval \\'90\\' day 
(3)\ngroup by\n l_returnflag,\n l_linestatus\norder by\n l_returnflag,\n 
l_linestatus;","sequential_pipe",129);
+    X_223:void := querylog.define("explain select\n l_returnflag,\n 
l_linestatus,\n sum(l_quantity) as sum_qty,\n sum(l_extendedprice) as 
sum_base_price,\n sum(l_extendedprice * (1 - l_discount)) as sum_disc_price,\n 
sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge,\n 
avg(l_quantity) as avg_qty,\n avg(l_extendedprice) as avg_price,\n 
avg(l_discount) as avg_disc,\n count(*) as count_order\nfrom\n 
lineitem\nwhere\n l_shipdate <= date \\'1998-12-01\\' - interval \\'90\\' day 
(3)\ngroup by\n l_returnflag,\n l_linestatus\norder by\n l_returnflag,\n 
l_linestatus;","sequential_pipe",129);
+    X_134 := bat.new(nil:str);
+    X_141 := bat.append(X_134,"sys.lineitem");
+    X_151 := bat.append(X_141,"sys.lineitem");
+    X_157 := bat.append(X_151,"sys.L1");
+    X_167 := bat.append(X_157,"sys.L2");
+    X_174 := bat.append(X_167,"sys.L3");
+    X_182 := bat.append(X_174,"sys.L4");
+    X_190 := bat.append(X_182,"sys.L5");
+    X_200 := bat.append(X_190,"sys.L6");
+    X_207 := bat.append(X_200,"sys.L7");
+    X_214 := bat.append(X_207,"sys.L10");
+    X_136 := bat.new(nil:str);
+    X_143 := bat.append(X_136,"l_returnflag");
+    X_152 := bat.append(X_143,"l_linestatus");
+    X_159 := bat.append(X_152,"sum_qty");
+    X_169 := bat.append(X_159,"sum_base_price");
+    X_176 := bat.append(X_169,"sum_disc_price");
+    X_184 := bat.append(X_176,"sum_charge");
+    X_192 := bat.append(X_184,"avg_qty");
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to