Skip to content

Commit b6693c2

Browse files
committed
Benchmark window function with multiple partitioning columns
1 parent d83a290 commit b6693c2

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

datafusion/core/benches/sql_planner.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,27 @@ fn criterion_benchmark(c: &mut Criterion) {
476476
});
477477
});
478478

479+
c.bench_function("physical_window_function_partition_by_8_on_values", |b| {
480+
let partitioning_columns = 8;
481+
let source = format!(
482+
"SELECT 1 AS n{}",
483+
(0..partitioning_columns)
484+
.map(|i| format!(", {i} AS c{i}"))
485+
.collect::<String>()
486+
);
487+
let window = format!(
488+
"SUM(n) OVER (PARTITION BY {}) AS sum_n",
489+
(0..partitioning_columns)
490+
.map(|i| format!("c{i}"))
491+
.collect::<Vec<_>>()
492+
.join(", ")
493+
);
494+
let query = format!("SELECT {window} FROM ({source})");
495+
b.iter(|| {
496+
physical_plan(&ctx, &rt, &query);
497+
});
498+
});
499+
479500
// Benchmark for Physical Planning Joins
480501
c.bench_function("physical_join_consider_sort", |b| {
481502
b.iter(|| {

0 commit comments

Comments
 (0)