Skip to content

TPC-Havoc Q16_v1

TPC-Havoc benchmark · all TPC-Havoc queries

Representative SQL

Rendered for DataFusion with default parameters.

SELECT
p_brand,
p_type,
p_size,
(
SELECT
COUNT(DISTINCT ps2.ps_suppkey)
FROM partsupp AS ps2, part AS p2
WHERE
p2.p_partkey = ps2.ps_partkey
AND p2.p_brand = p.p_brand
AND p2.p_type = p.p_type
AND p2.p_size = p.p_size
AND NOT ps2.ps_suppkey IN (
SELECT
s_suppkey
FROM supplier
WHERE
s_comment LIKE '%Customer%Complaints%'
)
) AS supplier_cnt
FROM part AS p
WHERE
p_brand <> 'Brand#45'
AND p_type NOT LIKE 'MEDIUM POLISHED%'
AND p_size IN (49, 14, 23, 45, 19, 3, 36, 9)
AND EXISTS(
SELECT
1
FROM partsupp AS ps3
WHERE
ps3.ps_partkey = p.p_partkey
AND NOT ps3.ps_suppkey IN (
SELECT
s_suppkey
FROM supplier
WHERE
s_comment LIKE '%Customer%Complaints%'
)
)
GROUP BY
p_brand,
p_type,
p_size
ORDER BY
supplier_cnt DESC,
p_brand,
p_type,
p_size

Representative DataFrame

No DataFrame implementation is registered for this query.

Get the exact query for your run

The blocks above are representative. To get the precise statement a specific platform runs at a specific scale, substitute your own values:

from benchbox import TPCHavoc
bench = TPCHavoc(scale_factor=0.01) # your scale factor
queries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQL
print(queries['16_v1'])

Source

Query text: benchbox/core/tpchavoc/variant_sets/q16.py