-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TPCH test on planner v2 #6060
Comments
Queries are referenced to https://github.com/pingcap/tidb/blob/master/cmd/explaintest/t/tpch.test |
#6073 will fix the |
Q15:
seems like Tabular SQL UDFs (UDTFs) I think we can skip this test and wait until the UDTFs are ready. |
It's actually a alias, we can rewrite as: create view revenue0 as
select
l_suppkey as supplier_no,
sum(l_extendedprice * (1 - l_discount)) as total_revenue
from
lineitem
where
l_shipdate >= to_date('1996-01-01')
and l_shipdate < addMonths(to_date('1996-01-01'), 3)
group by
l_suppkey; |
The error of Q5 is fixed by #6095 |
Q13 is supported by #6145 |
Q7 is supported but needs much time to get the result @BohuTANG mysql> source tpch-q7.sql
+-------------+-------------+--------+-------------------+
| supp_nation | cust_nation | l_year | revenue |
+-------------+-------------+--------+-------------------+
| FRANCE | GERMANY | 1995 | 54639732.73359999 |
| FRANCE | GERMANY | 1996 | 54633083.30759999 |
| GERMANY | FRANCE | 1995 | 52531746.66969999 |
| GERMANY | FRANCE | 1996 | 52520549.0224 |
+-------------+-------------+--------+-------------------+
4 rows in set (11 min 49.75 sec)
Read 7661265 rows, 1.12 GiB in 709.664 sec., 10.8 thousand rows/sec., 1.61 MiB/sec. |
Update the result, beside Q15, we only have seven queries left that didn't pass |
This can be rewritten into: select
supp_nation,
cust_nation,
l_year,
sum(volume) as revenue
from
(
select
n1.n_name as supp_nation,
n2.n_name as cust_nation,
extract(year from l_shipdate) as l_year,
l_extendedprice * (1 - l_discount) as volume
from
orders,
lineitem,
supplier,
customer,
nation n1,
nation n2
where
s_suppkey = l_suppkey
and o_orderkey = l_orderkey
and c_custkey = o_custkey
and s_nationkey = n1.n_nationkey
and c_nationkey = n2.n_nationkey
and (
(n1.n_name = 'FRANCE' and n2.n_name = 'GERMANY')
or (n1.n_name = 'GERMANY' and n2.n_name = 'FRANCE')
)
and l_shipdate between to_date('1995-01-01') and to_date('1996-12-31')
) as shipping
group by
supp_nation,
cust_nation,
l_year
order by
supp_nation,
cust_nation,
l_year; Which is much more effiecient than original query. Join reordering is complicated and has dependency on cost-based optmization, we will implement this later. |
I will test TPCH again today later :/ |
Yes, I have already rewritten it, so I got the result 🤣 |
For Q17 and Q21, you can try to increase your max open file descriptors in your local @BohuTANG |
Btw, Q19 isn't OOM, I'm debugging it |
It's because of the disjuntion, I have opened a issue for this #6096 |
Re-run the test for the TPCH test, and update the result. |
Good idea, but some queries may cost too much time, such as Q7. 🤔 |
Here I update my test results today and categorize them:
|
The test suite is mainly for the TPCH functional check, not the performance, so we can make the factor to
|
|
Update:
Server log:
|
For the last one Q18 I post a new issue here: #6556, close this issue. |
Summary
Result:
OK: Q1, Q3, Q4, Q5, Q6, Q8, Q9, Q10, Q11, Q12, Q13, Q14, Q15(Rewrite), Q16, Q19, Q20, Q21, Q22
OOM: Q2, Q7, Q17,
Q19,Q21Error:
Q16, Q18,Q20Test PC
Generating Test Data (1G)
Create Database and Table
Load TPCH data to databend
Queries
Q1(OK)
Q2(OOM)
Q3(OK)
Q4(OK)
Q5(OK)
Q6(OK)
Q7(OOM)
Q8(OK)
Q9(OK)
Q10(OK)
Q11(OK)
Q12(OK)
Q13(OK)
Q14(OK)
Q15(Rewrite by @leiysky)
Q16(Error)
Error:
Q17(OOM)
Q18(Error)
Error:
Q19(OOM)
Q20(Error)
Error:
Q21(OOM)
Q22(OK)
The text was updated successfully, but these errors were encountered: