Skip to content

TPC-Havoc Q16_v9

TPC-Havoc benchmark · all TPC-Havoc queries

Representative SQL

Rendered for DataFusion with default parameters.

WITH supplier_counts AS (
SELECT
p_brand,
p_type,
p_size,
COUNT(DISTINCT ps_suppkey) AS supplier_cnt,
RANK() OVER (ORDER BY COUNT(DISTINCT ps_suppkey) DESC, p_brand, p_type, p_size) AS cnt_rank
FROM partsupp, part
WHERE
p_partkey = ps_partkey
AND p_brand <> 'Brand#45'
AND p_type NOT LIKE 'MEDIUM POLISHED%'
AND p_size IN (49, 14, 23, 45, 19, 3, 36, 9)
AND NOT ps_suppkey IN (
SELECT
s_suppkey
FROM supplier
WHERE
s_comment LIKE '%Customer%Complaints%'
)
GROUP BY
p_brand,
p_type,
p_size
)
SELECT
p_brand,
p_type,
p_size,
supplier_cnt
FROM supplier_counts
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_v9'])

Source

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