Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name Q13
group clickbench_extended
subgroup ${CLICKBENCH_TYPE:-single}

init sql_benchmarks/clickbench/init/set_config.sql

load sql_benchmarks/clickbench/init/load-${CLICKBENCH_TYPE:-single}.sql

assert I
SELECT COUNT(*) > 0 from hits;
----
true

run
SELECT SUM("CounterID") AS counter_id_sum
FROM hits
WHERE "URL" < 'zzzz';

result sql_benchmarks/clickbench_extended/results/q13.csv
23 changes: 23 additions & 0 deletions benchmarks/sql_benchmarks/h2o/benchmarks/window/q13.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
subgroup window

name Q13
group h2o

echo Loading ${H2O_BENCH_SIZE:-small} window ${H2O_FILE_TYPE:-csv} h2o data

load sql_benchmarks/h2o/init/load_window_${H2O_BENCH_SIZE:-small}_${H2O_FILE_TYPE:-csv}.sql

assert I
SELECT COUNT(*) > 0 FROM x
----
true

run
-- Window Top-N (ROW_NUMBER top-2 per partition)
SELECT id2, largest2_v2 FROM (
SELECT id2, v2 AS largest2_v2,
ROW_NUMBER() OVER (PARTITION BY id2 ORDER BY v2 DESC) AS order_v2
FROM x WHERE v2 IS NOT NULL
) sub_query WHERE order_v2 <= 2;

result sql_benchmarks/h2o/results/window/${H2O_BENCH_SIZE:-small}/q13.csv
26 changes: 26 additions & 0 deletions benchmarks/sql_benchmarks/h2o/benchmarks/window/q14.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
subgroup window

name Q14
group h2o

echo Loading ${H2O_BENCH_SIZE:-small} window ${H2O_FILE_TYPE:-csv} h2o data

load sql_benchmarks/h2o/init/load_window_${H2O_BENCH_SIZE:-small}_${H2O_FILE_TYPE:-csv}.sql

assert I
SELECT COUNT(*) > 0 FROM x
----
true

run
-- Window Top-N partition cardinality sweep (id3 % N gives N distinct partitions).
-- These exercise PartitionedTopKExec across cardinalities to validate it stays

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since none of q13–q29 set it in init, I think these all run the SortExec + FilterExec baseline rather than the PartitionedTopKExec path?

-- competitive with the SortExec+Filter baseline as partition count grows.
-- Window Top-N: 100 partitions
SELECT pk, largest2_v2 FROM (
SELECT id3 % 100 AS pk, v2 AS largest2_v2,
ROW_NUMBER() OVER (PARTITION BY id3 % 100 ORDER BY v2 DESC) AS order_v2
FROM x WHERE v2 IS NOT NULL
) sub_query WHERE order_v2 <= 2;

result sql_benchmarks/h2o/results/window/${H2O_BENCH_SIZE:-small}/q14.csv
23 changes: 23 additions & 0 deletions benchmarks/sql_benchmarks/h2o/benchmarks/window/q15.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
subgroup window

name Q15
group h2o

echo Loading ${H2O_BENCH_SIZE:-small} window ${H2O_FILE_TYPE:-csv} h2o data

load sql_benchmarks/h2o/init/load_window_${H2O_BENCH_SIZE:-small}_${H2O_FILE_TYPE:-csv}.sql

assert I
SELECT COUNT(*) > 0 FROM x
----
true

run
-- Window Top-N: 1,000 partitions
SELECT pk, largest2_v2 FROM (
SELECT id3 % 1000 AS pk, v2 AS largest2_v2,
ROW_NUMBER() OVER (PARTITION BY id3 % 1000 ORDER BY v2 DESC) AS order_v2
FROM x WHERE v2 IS NOT NULL
) sub_query WHERE order_v2 <= 2;

result sql_benchmarks/h2o/results/window/${H2O_BENCH_SIZE:-small}/q15.csv
23 changes: 23 additions & 0 deletions benchmarks/sql_benchmarks/h2o/benchmarks/window/q16.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
subgroup window

name Q16
group h2o

echo Loading ${H2O_BENCH_SIZE:-small} window ${H2O_FILE_TYPE:-csv} h2o data

load sql_benchmarks/h2o/init/load_window_${H2O_BENCH_SIZE:-small}_${H2O_FILE_TYPE:-csv}.sql

assert I
SELECT COUNT(*) > 0 FROM x
----
true

run
-- Window Top-N: 10,000 partitions
SELECT pk, largest2_v2 FROM (
SELECT id3 % 10000 AS pk, v2 AS largest2_v2,
ROW_NUMBER() OVER (PARTITION BY id3 % 10000 ORDER BY v2 DESC) AS order_v2
FROM x WHERE v2 IS NOT NULL
) sub_query WHERE order_v2 <= 2;

result sql_benchmarks/h2o/results/window/${H2O_BENCH_SIZE:-small}/q16.csv
23 changes: 23 additions & 0 deletions benchmarks/sql_benchmarks/h2o/benchmarks/window/q17.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
subgroup window

name Q17
group h2o

echo Loading ${H2O_BENCH_SIZE:-small} window ${H2O_FILE_TYPE:-csv} h2o data

load sql_benchmarks/h2o/init/load_window_${H2O_BENCH_SIZE:-small}_${H2O_FILE_TYPE:-csv}.sql

assert I
SELECT COUNT(*) > 0 FROM x
----
true

run
-- Window Top-N: 100,000 partitions
SELECT pk, largest2_v2 FROM (
SELECT id3 % 100000 AS pk, v2 AS largest2_v2,
ROW_NUMBER() OVER (PARTITION BY id3 % 100000 ORDER BY v2 DESC) AS order_v2
FROM x WHERE v2 IS NOT NULL
) sub_query WHERE order_v2 <= 2;

result sql_benchmarks/h2o/results/window/${H2O_BENCH_SIZE:-small}/q17.csv
27 changes: 27 additions & 0 deletions benchmarks/sql_benchmarks/h2o/benchmarks/window/q18.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
subgroup window

name Q18
group h2o

echo Loading ${H2O_BENCH_SIZE:-small} window ${H2O_FILE_TYPE:-csv} h2o data

load sql_benchmarks/h2o/init/load_window_${H2O_BENCH_SIZE:-small}_${H2O_FILE_TYPE:-csv}.sql

assert I
SELECT COUNT(*) > 0 FROM x
----
true

run
-- Window Top-N (RANK top-2 per partition, ~100 partitions)
-- The RANK queries below mirror the ROW_NUMBER cardinality sweep
-- above and add heavy-ties variants. RANK semantics retain boundary
-- ties (`WHERE rk <= K` may keep more than K rows per partition), so
-- this exercises PartitionedTopKRank's ties-Vec path.
SELECT pk, largest_v2 FROM (
SELECT (id3 % 100) AS pk, v2 AS largest_v2,
RANK() OVER (PARTITION BY (id3 % 100) ORDER BY v2 DESC) AS rk_v2
FROM x WHERE v2 IS NOT NULL
) sub_query WHERE rk_v2 <= 2;

result sql_benchmarks/h2o/results/window/${H2O_BENCH_SIZE:-small}/q18.csv
23 changes: 23 additions & 0 deletions benchmarks/sql_benchmarks/h2o/benchmarks/window/q19.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
subgroup window

name Q19
group h2o

echo Loading ${H2O_BENCH_SIZE:-small} window ${H2O_FILE_TYPE:-csv} h2o data

load sql_benchmarks/h2o/init/load_window_${H2O_BENCH_SIZE:-small}_${H2O_FILE_TYPE:-csv}.sql

assert I
SELECT COUNT(*) > 0 FROM x
----
true

run
-- Window Top-N (RANK top-2 per partition, ~1K partitions)
SELECT pkey, largest_v2 FROM (
SELECT (id3 % 1000) AS pkey, v2 AS largest_v2,
RANK() OVER (PARTITION BY (id3 % 1000) ORDER BY v2 DESC) AS rk_v2
FROM x WHERE v2 IS NOT NULL
) sub_query WHERE rk_v2 <= 2;

result sql_benchmarks/h2o/results/window/${H2O_BENCH_SIZE:-small}/q19.csv
25 changes: 25 additions & 0 deletions benchmarks/sql_benchmarks/h2o/benchmarks/window/q20.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
subgroup window

name Q20
group h2o

echo Loading ${H2O_BENCH_SIZE:-small} window ${H2O_FILE_TYPE:-csv} h2o data

load sql_benchmarks/h2o/init/load_window_${H2O_BENCH_SIZE:-small}_${H2O_FILE_TYPE:-csv}.sql

assert I
SELECT COUNT(*) > 0 FROM x
----
true

run
-- Window Top-N (RANK top-2 per partition, ~1K partitions, heavy ties)
-- v2 % 10 forces 10 distinct OBY values, so most rows tie at the boundary
-- and exercise PartitionedTopKRank's ties-Vec path.
SELECT pkey, largest_v2 FROM (
SELECT (id3 % 1000) AS pkey, v2 AS largest_v2,
RANK() OVER (PARTITION BY (id3 % 1000) ORDER BY (v2 % 10) DESC) AS rk_v2
FROM x WHERE v2 IS NOT NULL
) sub_query WHERE rk_v2 <= 2;

result sql_benchmarks/h2o/results/window/${H2O_BENCH_SIZE:-small}/q20.csv
23 changes: 23 additions & 0 deletions benchmarks/sql_benchmarks/h2o/benchmarks/window/q21.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
subgroup window

name Q21
group h2o

echo Loading ${H2O_BENCH_SIZE:-small} window ${H2O_FILE_TYPE:-csv} h2o data

load sql_benchmarks/h2o/init/load_window_${H2O_BENCH_SIZE:-small}_${H2O_FILE_TYPE:-csv}.sql

assert I
SELECT COUNT(*) > 0 FROM x
----
true

run
-- Window Top-N (RANK top-2 per partition, ~10K partitions, low ties)
SELECT id2, largest_v2 FROM (
SELECT id2, v2 AS largest_v2,
RANK() OVER (PARTITION BY id2 ORDER BY v2 DESC) AS rk_v2
FROM x WHERE v2 IS NOT NULL
) sub_query WHERE rk_v2 <= 2;

result sql_benchmarks/h2o/results/window/${H2O_BENCH_SIZE:-small}/q21.csv
23 changes: 23 additions & 0 deletions benchmarks/sql_benchmarks/h2o/benchmarks/window/q22.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
subgroup window

name Q22
group h2o

echo Loading ${H2O_BENCH_SIZE:-small} window ${H2O_FILE_TYPE:-csv} h2o data

load sql_benchmarks/h2o/init/load_window_${H2O_BENCH_SIZE:-small}_${H2O_FILE_TYPE:-csv}.sql

assert I
SELECT COUNT(*) > 0 FROM x
----
true

run
-- Window Top-N (RANK top-2 per partition, ~10K partitions, heavy ties)
SELECT id2, largest_v2 FROM (
SELECT id2, v2 AS largest_v2,
RANK() OVER (PARTITION BY id2 ORDER BY (v2 % 10) DESC) AS rk_v2
FROM x WHERE v2 IS NOT NULL
) sub_query WHERE rk_v2 <= 2;

result sql_benchmarks/h2o/results/window/${H2O_BENCH_SIZE:-small}/q22.csv
23 changes: 23 additions & 0 deletions benchmarks/sql_benchmarks/h2o/benchmarks/window/q23.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
subgroup window

name Q23
group h2o

echo Loading ${H2O_BENCH_SIZE:-small} window ${H2O_FILE_TYPE:-csv} h2o data

load sql_benchmarks/h2o/init/load_window_${H2O_BENCH_SIZE:-small}_${H2O_FILE_TYPE:-csv}.sql

assert I
SELECT COUNT(*) > 0 FROM x
----
true

run
-- Window Top-N (RANK top-2 per partition, ~100K partitions)
SELECT pk, largest_v2 FROM (
SELECT (id3 % 100000) AS pk, v2 AS largest_v2,
RANK() OVER (PARTITION BY (id3 % 100000) ORDER BY v2 DESC) AS rk_v2
FROM x WHERE v2 IS NOT NULL
) sub_query WHERE rk_v2 <= 2;

result sql_benchmarks/h2o/results/window/${H2O_BENCH_SIZE:-small}/q23.csv
28 changes: 28 additions & 0 deletions benchmarks/sql_benchmarks/h2o/benchmarks/window/q24.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
subgroup window

name Q24
group h2o

echo Loading ${H2O_BENCH_SIZE:-small} window ${H2O_FILE_TYPE:-csv} h2o data

load sql_benchmarks/h2o/init/load_window_${H2O_BENCH_SIZE:-small}_${H2O_FILE_TYPE:-csv}.sql

assert I
SELECT COUNT(*) > 0 FROM x
----
true

run
-- Window Top-N (DENSE_RANK top-2 per partition, ~100 partitions)
-- The DENSE_RANK queries below mirror the RANK cardinality sweep above.
-- DENSE_RANK semantics keep every row whose ORDER BY value is among the
-- K distinct-greatest values in the partition, so total kept per partition
-- is unbounded in rows-per-distinct-value — exercises PartitionedTopKDenseRank's
-- HashMap-of-groups path.
SELECT pk, largest_v2 FROM (
SELECT (id3 % 100) AS pk, v2 AS largest_v2,
DENSE_RANK() OVER (PARTITION BY (id3 % 100) ORDER BY v2 DESC) AS dr_v2
FROM x WHERE v2 IS NOT NULL
) sub_query WHERE dr_v2 <= 2;

result sql_benchmarks/h2o/results/window/${H2O_BENCH_SIZE:-small}/q24.csv
23 changes: 23 additions & 0 deletions benchmarks/sql_benchmarks/h2o/benchmarks/window/q25.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
subgroup window

name Q25
group h2o

echo Loading ${H2O_BENCH_SIZE:-small} window ${H2O_FILE_TYPE:-csv} h2o data

load sql_benchmarks/h2o/init/load_window_${H2O_BENCH_SIZE:-small}_${H2O_FILE_TYPE:-csv}.sql

assert I
SELECT COUNT(*) > 0 FROM x
----
true

run
-- Window Top-N (DENSE_RANK top-2 per partition, ~1K partitions)
SELECT pkey, largest_v2 FROM (
SELECT (id3 % 1000) AS pkey, v2 AS largest_v2,
DENSE_RANK() OVER (PARTITION BY (id3 % 1000) ORDER BY v2 DESC) AS dr_v2
FROM x WHERE v2 IS NOT NULL
) sub_query WHERE dr_v2 <= 2;

result sql_benchmarks/h2o/results/window/${H2O_BENCH_SIZE:-small}/q25.csv
26 changes: 26 additions & 0 deletions benchmarks/sql_benchmarks/h2o/benchmarks/window/q26.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
subgroup window

name Q26
group h2o

echo Loading ${H2O_BENCH_SIZE:-small} window ${H2O_FILE_TYPE:-csv} h2o data

load sql_benchmarks/h2o/init/load_window_${H2O_BENCH_SIZE:-small}_${H2O_FILE_TYPE:-csv}.sql

assert I
SELECT COUNT(*) > 0 FROM x
----
true

run
-- Window Top-N (DENSE_RANK top-2 per partition, ~1K partitions, heavy ties)
-- v2 % 10 forces 10 distinct OBY values; most rows share the top-2 distinct
-- values so appends dominate — exercises the "Case A" append-to-existing-Vec
-- fast path in PartitionedTopKDenseRank.
SELECT pkey, largest_v2 FROM (
SELECT (id3 % 1000) AS pkey, v2 AS largest_v2,
DENSE_RANK() OVER (PARTITION BY (id3 % 1000) ORDER BY (v2 % 10) DESC) AS dr_v2
FROM x WHERE v2 IS NOT NULL
) sub_query WHERE dr_v2 <= 2;

result sql_benchmarks/h2o/results/window/${H2O_BENCH_SIZE:-small}/q26.csv
23 changes: 23 additions & 0 deletions benchmarks/sql_benchmarks/h2o/benchmarks/window/q27.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
subgroup window

name Q27
group h2o

echo Loading ${H2O_BENCH_SIZE:-small} window ${H2O_FILE_TYPE:-csv} h2o data

load sql_benchmarks/h2o/init/load_window_${H2O_BENCH_SIZE:-small}_${H2O_FILE_TYPE:-csv}.sql

assert I
SELECT COUNT(*) > 0 FROM x
----
true

run
-- Window Top-N (DENSE_RANK top-2 per partition, ~10K partitions, low ties)
SELECT id2, largest_v2 FROM (
SELECT id2, v2 AS largest_v2,
DENSE_RANK() OVER (PARTITION BY id2 ORDER BY v2 DESC) AS dr_v2
FROM x WHERE v2 IS NOT NULL
) sub_query WHERE dr_v2 <= 2;

result sql_benchmarks/h2o/results/window/${H2O_BENCH_SIZE:-small}/q27.csv
Loading