Skip to content

TPC-Havoc Q15_v9

TPC-Havoc benchmark · all TPC-Havoc queries

Representative SQL

Rendered for DataFusion with default parameters.

WITH revenue_ranked AS (
SELECT
l_suppkey AS supplier_no,
SUM(l_extendedprice * (
1 - l_discount
)) AS total_revenue,
RANK() OVER (ORDER BY SUM(l_extendedprice * (
1 - l_discount
)) DESC) AS revenue_rank,
MAX(SUM(l_extendedprice * (
1 - l_discount
))) OVER () AS max_revenue
FROM lineitem
WHERE
l_shipdate >= CAST('1996-01-01' AS DATE)
AND l_shipdate < CAST('1996-01-01' AS DATE) + INTERVAL '3 MONTH'
GROUP BY
l_suppkey
)
SELECT
s.s_suppkey,
s.s_name,
s.s_address,
s.s_phone,
rr.total_revenue
FROM supplier AS s
INNER JOIN revenue_ranked AS rr
ON s.s_suppkey = rr.supplier_no
WHERE
rr.revenue_rank = 1
ORDER BY
s.s_suppkey

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['15_v9'])

Source

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