Skip to content

Commit

Permalink
Merge pull request #503 from igorkonopko/olap-cs-q5
Browse files Browse the repository at this point in the history
Fix TPROC-H query 5 for Columnstore
  • Loading branch information
abondvt89 committed Feb 9, 2023
2 parents cac3337 + b565d6a commit fc63f7f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/mariadb/mariaolap.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,7 @@ proc set_query { myposition engine } {

if { [string equal -nocase $engine "Columnstore" ] } {
set sql(2) "select s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment from PART, SUPPLIER, PARTSUPP pso, NATION, REGION where p_partkey = pso.ps_partkey and s_suppkey = pso.ps_suppkey and p_size = :1 and p_type like '%:2' and s_nationkey = n_nationkey and n_regionkey = r_regionkey and r_name = ':3' and pso.ps_supplycost = ( select min(psi.ps_supplycost) from PARTSUPP psi, SUPPLIER, NATION, REGION where pso.ps_partkey = psi.ps_partkey and s_suppkey = psi.ps_suppkey and s_nationkey = n_nationkey and n_regionkey = r_regionkey and r_name = ':3') order by s_acctbal desc, n_name, s_name, p_partkey limit 100"
set sql(5) "select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue from CUSTOMER, ORDERS, LINEITEM, SUPPLIER, NATION, REGION where c_custkey = o_custkey and l_orderkey = o_orderkey and l_suppkey = s_suppkey and c_nationkey = s_nationkey + 0 and s_nationkey = n_nationkey and n_regionkey = r_regionkey and r_name = ':1' and o_orderdate >= date ':2' and o_orderdate < date ':2' + interval '1' year group by n_name order by revenue desc"
set sql(17) "select sum(l_extendedprice) / 7.0 as avg_yearly from LINEITEM lo, PART where p_partkey = l_partkey and p_brand = ':1' and p_container = ':2' and l_quantity < ( select 0.2 * avg(l_quantity) from LINEITEM where l_partkey = lo.l_partkey)"
set sql(19) "select sum(l_extendedprice* (1 - l_discount)) as revenue from LINEITEM, PART where p_partkey = l_partkey and (( p_brand = ':1' and p_container in ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG') and l_quantity >= :4 and l_quantity <= :4 + 10 and p_size between 1 and 5 and l_shipmode in ('AIR', 'AIR REG') and l_shipinstruct = 'DELIVER IN PERSON') or ( p_brand = ':2' and p_container in ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK') and l_quantity >= :5 and l_quantity <= :5 + 10 and p_size between 1 and 10 and l_shipmode in ('AIR', 'AIR REG') and l_shipinstruct = 'DELIVER IN PERSON') or ( p_brand = ':3' and p_container in ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG') and l_quantity >= :6 and l_quantity <= :6 + 10 and p_size between 1 and 15 and l_shipmode in ('AIR', 'AIR REG') and l_shipinstruct = 'DELIVER IN PERSON'))"
}
Expand Down

0 comments on commit fc63f7f

Please sign in to comment.