 PostgreSQL |
1186 7 GROUP BY SORT "left"(c_phone , 2) AGGREGATE COUNT(*), SUM(c_acctbal)
1532 12180 SORT "left"(c_phone , 2)
1532 12180 RIGHT ANTI JOIN HASH ON o_custkey = c_custkey
729 18412 │└TABLE SCAN customer WHERE (c_acctbal > (InitPlan 1) .col1) AND ("left"(c_phone , 2) IN('10','17','19','23','22','31','27'))
1935484 1500000 TABLE SCAN orders
|
 DuckDB |
0 7 SORT cntrycode
0 7 GROUP BY HASH #0 AGGREGATE count_star(), SUM(#1)
2 12180 PROJECT cntrycode, c_acctbal
2 12180 PROJECT cntrycode, c_acctbal
2 0 RIGHT SEMI INNER JOIN HASH ON c_custkey IS NOT DISTINCT FROM c_custkey
9 18412 │└GROUP BY HASH #2 AGGREGATE
2 12180 │ RIGHT ANTI JOIN HASH ON c_custkey IS NOT DISTINCT FROM c_custkey
9 0 │ │└SCAN EMPTY
90 187159 │ PROJECT c_custkey
90 187159 │ INNER JOIN HASH ON o_custkey = c_custkey
9 0 │ │└SCAN MATERIALISED
1500000 1499803 │ TABLE SCAN orders
10 18412 INNER JOIN LOOP ON CAST(c_acctbal AS DOUBLE) > SUBQUERY
30000 1 │└GROUP BY SIMPLE AGGREGATE "first" #0, count_star()
30000 1 │ GROUP BY SIMPLE AGGREGATE avg #0
30000 36642 │ PROJECT c_acctbal
30000 36642 │ TABLE SCAN customer WHERE c_acctbal > 0.000 AND ("left"(c_phone, 2) IN('10','17','19','23','22','31','27'))
30000 40336 TABLE SCAN customer WHERE "left"(c_phone, 2) IN('10','17','19','23','22','31','27')
|
 SQL Server |
422 7 SORT Expr1009
422 7 PROJECT CONVERT_IMPLICIT int,Expr1022,0 AS Expr1010
422 7 GROUP BY HASH AGGREGATE COUNT(*) AS Expr1022, SUM(c_acctbal) AS Expr1011
3033 12177 INNER JOIN HASH ON o_custkey = c_custkey
4557 18407 │└INNER JOIN LOOP ON substring(c_phone, 1 , 2) = '27' OR substring(c_phone, 1 , 2) = '31' OR substring(c_phone, 1 , 2) = '22' OR substring(c_phone, 1 , 2) = '23' OR substring(c_phone, 1 , 2) = '19' OR substring(c_phone, 1 , 2) = '17' OR substring(c_phone, 1 , 2) = '10'
10026 40336 │ │└PROJECT substring(c_phone, 1 , 2) AS Expr1009
10026 40336 │ │ TABLE SEEK customer WHERE substring(c_phone, 1 , 2) = '27' OR substring(c_phone, 1 , 2) = '31' OR substring(c_phone, 1 , 2) = '22' OR substring(c_phone, 1 , 2) = '23' OR substring(c_phone, 1 , 2) = '19' OR substring(c_phone, 1 , 2) = '17' OR substring(c_phone, 1 , 2) = '10'
1 1 │ PROJECT CASE WHEN Expr1020 = 0 THEN NULL ELSE Expr1021 / CONVERT_IMPLICIT(decimal 19,0 ,Expr1020,0) END AS Expr1004
1 1 │ GROUP BY HASH AGGREGATE COUNT(*) AS Expr1020, SUM(c_acctbal) AS Expr1021
9556 36640 │ TABLE SEEK customer WHERE c_acctbal > 0.00 AND (substring(c_phone, 1 , 2) = '27' OR substring(c_phone, 1 , 2) = '31' OR substring(c_phone, 1 , 2) = '22' OR substring(c_phone, 1 , 2) = '23' OR substring(c_phone, 1 , 2) = '19' OR substring(c_phone, 1 , 2) = '17' OR substring(c_phone, 1 , 2) = '10')
1500000 1500000 TABLE SEEK orders
|