Repository navigation
Conversation
|
Run benchmarks |
|
🤖 Benchmark running (GKE) | trigger CPU Details (lscpu)Comparing perf/ranked-neighbors (df3e4e2) to 04b9108 (merge-base) diff Run configurationrun benchmark tpcdsResults will be posted here when complete File an issue against this benchmark runner |
|
🤖 Benchmark running (GKE) | trigger CPU Details (lscpu)Comparing perf/ranked-neighbors (df3e4e2) to 04b9108 (merge-base) diff Run configurationrun benchmark tpchResults will be posted here when complete File an issue against this benchmark runner |
|
🤖 Benchmark running (GKE) | trigger CPU Details (lscpu)Comparing perf/ranked-neighbors (df3e4e2) to 04b9108 (merge-base) diff Run configurationrun benchmark clickbench_partitionedResults will be posted here when complete File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Instance: Comparing perf/ranked-neighbors (df3e4e2) to 04b9108 (merge-base) diff Run configurationrun benchmark tpchCPU Details (lscpu)Details
Resource Usagetpch — base (merge-base)
tpch — branch
File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Instance: Comparing perf/ranked-neighbors (df3e4e2) to 04b9108 (merge-base) diff Run configurationrun benchmark tpcdsCPU Details (lscpu)Details
Resource Usagetpcds — base (merge-base)
tpcds — branch
File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Instance: Comparing perf/ranked-neighbors (df3e4e2) to 04b9108 (merge-base) diff Run configurationrun benchmark clickbench_partitionedCPU Details (lscpu)Details
Resource Usageclickbench_partitioned — base (merge-base)
clickbench_partitioned — branch
File an issue against this benchmark runner |
Which issue does this PR close?
No linked issue.
Rationale for this change
TPC-DS Q47 and Q57 each join the same ranked input three times to obtain the preceding and following row. One pass over the grouped input can supply all three outputs.
What changes are included in this PR?
Recognize ordinary equality joins on adjacent ranks when grouping proves the ordering has no peers. Replace the two neighbor joins with offset-one windows. Check neighbor existence independently of nullable payloads and exclude NULL partition keys according to inner-join semantics. The separate batched evaluation experiment gave mixed incremental results and is omitted.
What is the testing strategy for this PR?
Compare the full original Q47 and Q57 results with the baseline. Exercise tied ranks, NULL partition keys, NULL payloads, nonunit offsets and small record batches.
Independent release builds from
04b910869on macOS arm64, using DuckDB 1.4.1 SF1 Parquet data, upstream query files and ten target partitions. For each arm, five fresh processes ran the original query seven times each. Values are median warm SQL times in milliseconds, excluding the first execution of each process. Each independently built patch also completed all 22 TPC-H and 99 TPC-DS queries with baseline row counts.The executed Q47 and Q57 plans each use a single ranked producer. Both retained all 100 result rows. In a separate ablation, adding batched offset-one evaluation to the rewrite changed Q47 from 46.35 to 44.40 ms and Q57 from 31.90 to 32.20 ms. This PR contains the logical rewrite alone.
Reproduce a query from the benchmarks directory with:
Are there any user-facing changes?
Eligible ranked self-joins can be replaced by bounded windows.
Implementation and benchmark preparation were AI-assisted.