Skip to content

TPC-Havoc Q5_v6

TPC-Havoc benchmark · all TPC-Havoc queries

Representative SQL

Rendered for DataFusion with default parameters.

SELECT
nation_name,
total_revenue
FROM (
SELECT
n_name AS nation_name,
SUM(l_extendedprice * (
1 - l_discount
)) AS total_revenue
FROM customer, orders, lineitem, supplier, nation, region
WHERE
c_custkey = o_custkey
AND l_orderkey = o_orderkey
AND l_suppkey = s_suppkey
AND c_nationkey = s_nationkey
AND s_nationkey = n_nationkey
AND n_regionkey = r_regionkey
AND r_name = 'ASIA'
AND o_orderdate >= CAST('1994-01-01' AS DATE)
AND o_orderdate < CAST('1994-01-01' AS DATE) + INTERVAL '1 YEAR'
GROUP BY
n_name
) AS nation_revenue
ORDER BY
total_revenue 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['5_v6'])

Source

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