Skip to content

TPC-Havoc Q13_v5

TPC-Havoc benchmark · all TPC-Havoc queries

Representative SQL

Rendered for DataFusion with default parameters.

WITH filtered_orders AS (
SELECT
o_orderkey,
o_custkey
FROM orders
WHERE
o_comment NOT LIKE '%special%requests%'
), customer_order_counts AS (
SELECT
c.c_custkey,
COUNT(fo.o_orderkey) AS c_count
FROM customer AS c
LEFT OUTER JOIN filtered_orders AS fo
ON c.c_custkey = fo.o_custkey
GROUP BY
c.c_custkey
), distribution_analysis AS (
SELECT
c_count,
COUNT(*) AS custdist
FROM customer_order_counts
GROUP BY
c_count
)
SELECT
c_count,
custdist
FROM distribution_analysis
ORDER BY
custdist DESC,
c_count 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['13_v5'])

Source

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