PlannerTPC-H — TPCH-Q10

Engine Compare

Accuracy chart, rows processed ?
Scan
Scan
Join Probe
Join
Sort
Sort
Hash Build
Hash
Aggregate
Agg
Distribute
Dist
DuckDB
1,596,791 rows
1.6M
1,692,690 rows
1.7M
30,170 rows
30K
312,391 rows
312K
108,325 rows
108K
0 rows
0
PostgreSQL
1,596,845 rows
1.6M
1,609,400 rows
1.6M
138,495 rows
138K
366,650 rows
367K
108,325 rows
108K
0 rows
0
SQL Server
1,596,844 rows
1.6M
1,572,918 rows
1.6M
30,170 rows
30K
168,665 rows
169K
108,325 rows
108K
0 rows
0

Actual Query Plans

Query Plan per Engine ?
Query Plan
PostgreSQL
Estimate    Actual  Operator
   51264     30170  SORT SUM(l_extendedprice * ('1' - l_discount))
   51264     30170  GROUP BY SORT c_custkey, n_name AGGREGATE c_name, SUM(l_extendedprice * ('1' - l_discount)), c_acctbal, c_address, c_phone, c_comment
   64080    108325  SORT c_custkey, n_name
   64080    108325  INNER JOIN HASH ON c_nationkey = n_nationkey
      25        25  │└TABLE SCAN nation
   64080    108325  INNER JOIN HASH ON o_custkey = c_custkey
  312500    150000  │└TABLE SCAN customer
   64080    108325  INNER JOIN HASH ON l_orderkey = o_orderkey
   88810     54070  │└TABLE SCAN orders WHERE (o_orderdate >= '1994-06-01') AND (o_orderdate < '1994-09-01')
 1745655   1392750  TABLE SCAN lineitem WHERE l_returnflag = 'R'
DuckDB
Estimate    Actual  Operator
  410170     30170  SORT SUM(l_extendedprice * (1 - l_discount))
  410170     30170  PROJECT c_custkey, c_name, revenue, c_acctbal, n_name, c_address, c_phone, c_comment
  410170     30170  GROUP BY HASH #0, #1, #2, #3, #4, #5, #6 AGGREGATE SUM(#7)
  410170    108325  PROJECT c_custkey, c_name, c_acctbal, c_phone, n_name, c_address, c_comment, l_extendedprice * (1.000 - l_discount)
  410170    108325  INNER JOIN HASH ON l_orderkey = o_orderkey
  304964     54071  │└INNER JOIN HASH ON c_custkey = o_custkey
  300000     54071   │└TABLE SCAN orders WHERE o_orderdate >= '1994-06-01' AND o_orderdate < '1994-09-01'
  144230    149995   INNER JOIN HASH ON c_nationkey = n_nationkey
      25        25   │└TABLE SCAN nation
  150000    149995   TABLE SCAN customer WHERE c_custkey >= 3
 1999607   1392700  TABLE SCAN lineitem WHERE l_returnflag = 'R'
SQL Server
Estimate    Actual  Operator
   26485     30170  SORT Expr1009
   26485     30170  INNER JOIN HASH ON n_nationkey = c_nationkey
      25        25  │└TABLE SEEK nation
   26485     30170  INNER JOIN HASH ON c_custkey = o_custkey
   26508     30170  │└PROJECT CASE WHEN Expr1015 = 0 THEN NULL ELSE Expr1016 END AS Expr1009
   26508     30170   GROUP BY HASH AGGREGATE COUNT(Expr1010) AS Expr1015, SUM(Expr1010) AS Expr1016
   56510    108325   INNER JOIN HASH ON o_orderkey = l_orderkey
   54363     54071   │└TABLE SEEK orders WHERE o_orderdate >= '1994-06-01' AND o_orderdate < '1994-09-01'
 1381930   1392748   PROJECT l_extendedprice * (1. - l_discount) AS Expr1010
 1381930   1392748   TABLE SCAN lineitem
  150000    150000  TABLE SEEK customer