Changeset: a339d40c21a7 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a339d40c21a7 Modified Files: sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out.int128 sql/benchmarks/tpch/LOCKED/Tests/14.stable.out.int128 sql/benchmarks/tpch/Tests/01-22.stable.out sql/benchmarks/tpch/Tests/01-22.stable.out.int128 sql/benchmarks/tpch/Tests/14.stable.out.int128 sql/common/sql_types.c sql/server/rel_optimizer.c sql/server/rel_select.c sql/server/sql_parser.y sql/test/BugTracker/Tests/caching.SF-1651599.stable.out sql/test/Tests/systemfunctions.stable.out sql/test/Tests/systemfunctions.stable.out.int128 sql/test/analytics/Tests/analytics09.stable.err sql/test/emptydb/Tests/check.stable.out.int128 sql/test/mergetables/Tests/mergedb.Bug-6820.stable.out Branch: default Log Message:
many small fixes for the tpcds queries. 1) no longer strip zero's add the end of a literal (ie 0.0100 is now a decimal(5.4) not a (3.2) 2) analytical avg returns doubles for decimals (like the group by aggregate case) 3) improved handling of conditional execution (case statements). Referenced relations are optimized only once (which is a requirement for the case_fixup rewriter (as it introduces new expressions)) 4) other analytical window functions now return a type based on the input (is sets scale) diffs (truncated from 950 to 300 lines): diff --git a/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out b/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out --- a/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out +++ b/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out @@ -134,7 +134,7 @@ Ready. # o_orderpriority #order by # o_orderpriority; -% sys.orders, sys.L10 # table_name +% sys.orders, sys.L12 # table_name % o_orderpriority, order_count # name % char, bigint # type % 15, 3 # length @@ -610,7 +610,7 @@ Ready. # and l_shipdate < l_commitdate # and l_receiptdate >= date '1994-01-01' # and l_receiptdate < date '1994-01-01' + interval '1' year -% sys.lineitem, sys.L6, sys.L11 # table_name +% sys.lineitem, sys.L4, sys.L7 # table_name % l_shipmode, high_line_count, low_line_count # name % char, bigint, bigint # type % 10, 2, 2 # length @@ -641,7 +641,7 @@ Ready. #order by # custdist desc, # c_count desc; -% .c_orders, .L10 # table_name +% .c_orders, .L7 # table_name % c_count, custdist # name % bigint, bigint # type % 2, 3 # length @@ -743,7 +743,7 @@ Ready. # p_brand, # p_type, # p_size; -% sys.part, sys.part, sys.part, sys.L13 # table_name +% sys.part, sys.part, sys.part, sys.L11 # table_name % p_brand, p_type, p_size, supplier_cnt # name % char, varchar, int, bigint # type % 10, 25, 2, 1 # length @@ -1108,8 +1108,8 @@ Ready. # o_totalprice desc, # o_orderdate #limit 100; -% sys.customer, sys.customer, sys.orders, sys.orders, sys.orders, sys.L17 # table_name -% c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, L16 # name +% sys.customer, sys.customer, sys.orders, sys.orders, sys.orders, sys.L14 # table_name +% c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, L14 # name % varchar, int, int, date, decimal, decimal # type % 18, 3, 5, 10, 17, 20 # length [ "Customer#000000667", 667, 29158, 1995-10-21, 439687.23, 305.00 ] @@ -1140,7 +1140,7 @@ Ready. # and p_brand = 'Brand#23' # and p_container in ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK') # and l_quantity >= 10 and l_quantity <= 10 + 10 -% sys.L33 # table_name +% sys.L22 # table_name % revenue # name % decimal # type % 20 # length @@ -1187,7 +1187,7 @@ Ready. # l3.l_orderkey = l1.l_orderkey # and l3.l_suppkey <> l1.l_suppkey # and l3.l_receiptdate > l3.l_commitdate -% sys.supplier, sys.L22 # table_name +% sys.supplier, sys.L23 # table_name % s_name, numwait # name % char, bigint # type % 25, 1 # length @@ -1225,7 +1225,7 @@ Ready. # select # * # from -% sys.custsale, sys.L21, sys.L24 # table_name +% sys.custsale, sys.L20, sys.L23 # table_name % cntrycode, numcust, totacctbal # name % clob, bigint, decimal # type % 2, 2, 20 # length diff --git a/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out.int128 b/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out.int128 --- a/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out.int128 +++ b/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out.int128 @@ -134,7 +134,7 @@ Ready. # o_orderpriority #order by # o_orderpriority; -% sys.orders, sys.L10 # table_name +% sys.orders, sys.L12 # table_name % o_orderpriority, order_count # name % char, bigint # type % 15, 3 # length @@ -610,7 +610,7 @@ Ready. # and l_shipdate < l_commitdate # and l_receiptdate >= date '1994-01-01' # and l_receiptdate < date '1994-01-01' + interval '1' year -% sys.lineitem, sys.L6, sys.L11 # table_name +% sys.lineitem, sys.L4, sys.L7 # table_name % l_shipmode, high_line_count, low_line_count # name % char, hugeint, hugeint # type % 10, 2, 2 # length @@ -641,7 +641,7 @@ Ready. #order by # custdist desc, # c_count desc; -% .c_orders, .L10 # table_name +% .c_orders, .L7 # table_name % c_count, custdist # name % bigint, bigint # type % 2, 3 # length @@ -700,7 +700,7 @@ Ready. % promo_revenue # name % decimal # type % 40 # length -[ 15.48654 ] +[ 15.486545 ] % sys.supplier, sys.supplier, sys.supplier, sys.supplier, sys.revenue0 # table_name % s_suppkey, s_name, s_address, s_phone, total_revenue # name @@ -743,7 +743,7 @@ Ready. # p_brand, # p_type, # p_size; -% sys.part, sys.part, sys.part, sys.L13 # table_name +% sys.part, sys.part, sys.part, sys.L11 # table_name % p_brand, p_type, p_size, supplier_cnt # name % char, varchar, int, bigint # type % 10, 25, 2, 1 # length @@ -1108,8 +1108,8 @@ Ready. # o_totalprice desc, # o_orderdate #limit 100; -% sys.customer, sys.customer, sys.orders, sys.orders, sys.orders, sys.L17 # table_name -% c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, L16 # name +% sys.customer, sys.customer, sys.orders, sys.orders, sys.orders, sys.L14 # table_name +% c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, L14 # name % varchar, int, int, date, decimal, decimal # type % 18, 3, 5, 10, 17, 40 # length [ "Customer#000000667", 667, 29158, 1995-10-21, 439687.23, 305.00 ] @@ -1140,7 +1140,7 @@ Ready. # and p_brand = 'Brand#23' # and p_container in ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK') # and l_quantity >= 10 and l_quantity <= 10 + 10 -% sys.L33 # table_name +% sys.L22 # table_name % revenue # name % decimal # type % 40 # length @@ -1225,7 +1225,7 @@ Ready. # l3.l_orderkey = l1.l_orderkey # and l3.l_suppkey <> l1.l_suppkey # and l3.l_receiptdate > l3.l_commitdate -% sys.supplier, sys.L22 # table_name +% sys.supplier, sys.L23 # table_name % s_name, numwait # name % char, bigint # type % 25, 1 # length @@ -1263,7 +1263,7 @@ Ready. # select # * # from -% sys.custsale, sys.L21, sys.L24 # table_name +% sys.custsale, sys.L20, sys.L23 # table_name % cntrycode, numcust, totacctbal # name % clob, bigint, decimal # type % 2, 2, 40 # length diff --git a/sql/benchmarks/tpch/LOCKED/Tests/14.stable.out.int128 b/sql/benchmarks/tpch/LOCKED/Tests/14.stable.out.int128 --- a/sql/benchmarks/tpch/LOCKED/Tests/14.stable.out.int128 +++ b/sql/benchmarks/tpch/LOCKED/Tests/14.stable.out.int128 @@ -34,7 +34,7 @@ Ready. % promo_revenue # name % decimal # type % 40 # length -[ 15.48654 ] +[ 15.486545 ] # 09:17:18 > # 09:17:18 > Done. diff --git a/sql/benchmarks/tpch/Tests/01-22.stable.out b/sql/benchmarks/tpch/Tests/01-22.stable.out --- a/sql/benchmarks/tpch/Tests/01-22.stable.out +++ b/sql/benchmarks/tpch/Tests/01-22.stable.out @@ -134,7 +134,7 @@ Ready. # o_orderpriority #order by # o_orderpriority; -% sys.orders, sys.L10 # table_name +% sys.orders, sys.L12 # table_name % o_orderpriority, order_count # name % char, bigint # type % 15, 3 # length @@ -610,7 +610,7 @@ Ready. # and l_shipdate < l_commitdate # and l_receiptdate >= date '1994-01-01' # and l_receiptdate < date '1994-01-01' + interval '1' year -% sys.lineitem, sys.L6, sys.L11 # table_name +% sys.lineitem, sys.L4, sys.L7 # table_name % l_shipmode, high_line_count, low_line_count # name % char, bigint, bigint # type % 10, 2, 2 # length @@ -641,7 +641,7 @@ Ready. #order by # custdist desc, # c_count desc; -% .c_orders, .L10 # table_name +% .c_orders, .L7 # table_name % c_count, custdist # name % bigint, bigint # type % 2, 3 # length @@ -739,7 +739,7 @@ Ready. # p_brand, # p_type, # p_size; -% sys.part, sys.part, sys.part, sys.L13 # table_name +% sys.part, sys.part, sys.part, sys.L11 # table_name % p_brand, p_type, p_size, supplier_cnt # name % char, varchar, int, bigint # type % 10, 25, 2, 1 # length @@ -1104,8 +1104,8 @@ Ready. # o_totalprice desc, # o_orderdate #limit 100; -% sys.customer, sys.customer, sys.orders, sys.orders, sys.orders, sys.L17 # table_name -% c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, L16 # name +% sys.customer, sys.customer, sys.orders, sys.orders, sys.orders, sys.L14 # table_name +% c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, L14 # name % varchar, int, int, date, decimal, decimal # type % 18, 3, 5, 10, 17, 20 # length [ "Customer#000000667", 667, 29158, 1995-10-21, 439687.23, 305.00 ] @@ -1136,7 +1136,7 @@ Ready. # and p_brand = 'Brand#23' # and p_container in ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK') # and l_quantity >= 10 and l_quantity <= 10 + 10 -% sys.L33 # table_name +% sys.L22 # table_name % revenue # name % decimal # type % 20 # length @@ -1183,7 +1183,7 @@ Ready. # l3.l_orderkey = l1.l_orderkey # and l3.l_suppkey <> l1.l_suppkey # and l3.l_receiptdate > l3.l_commitdate -% sys.supplier, sys.L22 # table_name +% sys.supplier, sys.L23 # table_name % s_name, numwait # name % char, bigint # type % 25, 1 # length @@ -1221,7 +1221,7 @@ Ready. # select # * # from -% sys.custsale, sys.L21, sys.L24 # table_name +% sys.custsale, sys.L20, sys.L23 # table_name % cntrycode, numcust, totacctbal # name % clob, bigint, decimal # type % 2, 2, 20 # length diff --git a/sql/benchmarks/tpch/Tests/01-22.stable.out.int128 b/sql/benchmarks/tpch/Tests/01-22.stable.out.int128 --- a/sql/benchmarks/tpch/Tests/01-22.stable.out.int128 +++ b/sql/benchmarks/tpch/Tests/01-22.stable.out.int128 @@ -134,7 +134,7 @@ Ready. # o_orderpriority #order by # o_orderpriority; -% sys.orders, sys.L10 # table_name +% sys.orders, sys.L12 # table_name % o_orderpriority, order_count # name % char, bigint # type % 15, 3 # length @@ -610,7 +610,7 @@ Ready. # and l_shipdate < l_commitdate # and l_receiptdate >= date '1994-01-01' # and l_receiptdate < date '1994-01-01' + interval '1' year -% sys.lineitem, sys.L6, sys.L11 # table_name +% sys.lineitem, sys.L4, sys.L7 # table_name % l_shipmode, high_line_count, low_line_count # name % char, hugeint, hugeint # type % 10, 2, 2 # length @@ -641,7 +641,7 @@ Ready. #order by # custdist desc, # c_count desc; -% .c_orders, .L10 # table_name +% .c_orders, .L7 # table_name % c_count, custdist # name % bigint, bigint # type % 2, 3 # length @@ -700,7 +700,11 @@ Ready. % promo_revenue # name % decimal # type % 40 # length -[ 15.48654 ] +[ 15.486545 ] + +# 18:03:42 > +# 18:03:42 > mclient -lsql -ftest -tnone -Eutf-8 -i -e --host=/var/tmp/mtest-10362 --port=37514 < /home/niels/data/MonetDB/sql/benchmarks/tpch/15.sql +# 18:03:42 > % sys.supplier, sys.supplier, sys.supplier, sys.supplier, sys.revenue0 # table_name % s_suppkey, s_name, s_address, s_phone, total_revenue # name @@ -743,7 +747,7 @@ Ready. # p_brand, # p_type, # p_size; -% sys.part, sys.part, sys.part, sys.L13 # table_name _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list