Skip to content

TPC-Havoc Q11_v5

TPC-Havoc benchmark · all TPC-Havoc queries

Representative SQL

Rendered for DataFusion with default parameters.

WITH german_suppliers AS (
SELECT
s_suppkey
FROM supplier, nation
WHERE
s_nationkey = n_nationkey AND n_name = 'GERMANY'
), inventory_values AS (
SELECT
ps_partkey,
ps_supplycost * ps_availqty AS part_value
FROM partsupp, german_suppliers
WHERE
ps_suppkey = s_suppkey
), total_threshold AS (
SELECT
SUM(part_value) * 0.0100000000 AS threshold
FROM inventory_values
), part_totals AS (
SELECT
ps_partkey,
SUM(part_value) AS value
FROM inventory_values
GROUP BY
ps_partkey
)
SELECT
pt.ps_partkey,
pt.value
FROM part_totals AS pt, total_threshold AS tt
WHERE
pt.value > tt.threshold
ORDER BY
pt.value DESC

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['11_v5'])

Source

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