Skip to content

perf: resolve schema fields by name index instead of scanning - #24316

Draft
zhuqi-lucas wants to merge 3 commits into
apache:mainfrom
zhuqi-lucas:dfschema-name-index
Draft

perf: resolve schema fields by name index instead of scanning#24316
zhuqi-lucas wants to merge 3 commits into
apache:mainfrom
zhuqi-lucas:dfschema-name-index

Conversation

@zhuqi-lucas

Copy link
Copy Markdown
Contributor

Which issue does this close?

Related to #24264. This is an alternative to #24281 that stays entirely inside the "make it cheaper" lane: it does not change any schema that is produced, so it does not depend on the semantics question raised in #24284.

Rationale for this change

Deriving a projection's output schema is quadratic in the number of columns, and the constant is doubled for aliases.

Two independent causes:

  1. Name lookup is a linear scan. DFSchema has no name to index map, so index_of_column_by_name and qualified_fields_with_unqualified_name walk every field. Expr::Column's to_field goes through field_from_column to the latter, which additionally allocates a Vec per lookup. With N expressions over an M-column schema that is O(N*M).

  2. The alias arm resolves twice. In Expr::to_field, Expr::Alias calls expr.metadata(schema) and then expr.to_field(schema). Expr::metadata is defined as to_field(..).1.metadata(), so the inner expression, and therefore the schema, is walked a second time for no extra information.

This shows up on plans with many wide col AS col alias projections, where an alias is not a bare Column so is_projection_unnecessary keeps the projection and its schema is derived again on every pass.

What changes are included in this PR?

  • DFSchema gains a lazily built name_index mapping a field name to the ascending indices carrying it. index_of_column_by_name and qualified_fields_with_unqualified_name consult it instead of scanning, and the latter stops allocating a Vec on every lookup.
  • Expr::to_field's Expr::Alias arm resolves the aliased expression once and takes the metadata from the resulting field.

The index is derived state: it takes no part in PartialEq, Clone starts a fresh cache rather than copying one, and Debug is now hand written so it prints exactly the three real fields as before. That last point matters because plan snapshots compare the Debug string and a HashMap's iteration order is not deterministic; deriving Debug with the new field made datafusion-sql's test_avoid_add_alias fail nondeterministically.

Correctness

Every arm of the lookup rules already required the field name to match, so restricting the walk to same-named candidates and applying the qualifier rules in index order returns exactly what the full scan returned, including which duplicate wins and which lookups miss.

name_index_matches_linear_scan pins this by keeping the previous scan as a reference implementation and comparing both lookups across qualifier and name combinations, over a schema with the same name under two relations, qualified and unqualified fields, a non-ASCII name and absent names. name_index_is_derived_state covers clone, strip_qualifiers and replace_qualifier, where the qualifiers change and stale answers would be visible.

Both tests were checked against deliberate mutations: reversing the candidate order and making the qualifier comparison always true each make them fail.

Performance

to_field over W col AS col aliases against a W-column schema, per iteration over 3000 iterations:

W before after speedup
18 26.74 us 12.03 us 2.2x
40 75.40 us 18.64 us 4.0x
100 394.8 us 47.21 us 8.4x
300 3124 us 141.4 us 22.1x

Per-expression cost goes from 0.98 us at W=18 to 5.32 us at W=300 before, and holds at about 0.47 us after, so the quadratic term is gone. At narrow widths the alias change is what pays; the index takes over as the schema widens.

This is a microbenchmark of to_field in isolation. An end to end optimizer pass will see a smaller number, since it includes work neither change touches.

The two changes are independent and can be split if you would prefer to review them separately.

Are there any user-facing changes?

No. Lookup results, schemas and Debug output are unchanged; this is purely a cost reduction.

Field lookup by name was linear in the schema width, and the alias branch
of `Expr::to_field` paid for it twice. Together that made deriving a
projection's schema quadratic in the number of columns.

Two independent changes:

- `DFSchema` gains a lazily built map from field name to the ascending
  indices carrying it. `index_of_column_by_name` and
  `qualified_fields_with_unqualified_name` consult it instead of walking
  every field, and the latter no longer allocates a `Vec` per lookup.
  Every arm of the lookup rules already required the field name to match,
  so restricting the walk to same-named candidates and applying the
  qualifier rules in index order returns exactly what the scan returned,
  including which duplicate wins.

- `Expr::to_field`'s `Expr::Alias` arm resolved the aliased expression
  twice: `Expr::metadata` is itself `to_field(..).1.metadata()`, so
  calling it alongside `to_field` walked the inner expression, and thus
  the schema, a second time for no extra information.

The index is derived state and takes no part in equality, and `Debug` is
now written by hand so it keeps printing exactly the three real fields.
Plan snapshots compare that string and a `HashMap`'s iteration order is
not deterministic. `Clone` starts a fresh cache rather than copying one.

Timings for `to_field` over W `col AS col` aliases against a W-column
schema, which is the shape wide view-matcher style projections produce
(per iteration, 3000 iterations):

| W   | before   | after    |
|-----|----------|----------|
| 18  | 26.74 us | 12.03 us |
| 40  | 75.40 us | 18.64 us |
| 100 | 394.8 us | 47.21 us |
| 300 | 3124 us  | 141.4 us |

Per-expression cost goes from 0.98 us at W=18 to 5.32 us at W=300 before,
and holds at about 0.47 us after, i.e. the quadratic term is gone. At
narrow widths the alias change is what pays; the index takes over as the
schema widens.

`name_index_matches_linear_scan` pins the equivalence by keeping the
previous scan as a reference implementation and comparing both lookups
across qualifier and name combinations, over a schema with the same name
under two relations, qualified and unqualified fields, a non-ASCII name
and absent names. `name_index_is_derived_state` covers clone,
`strip_qualifiers` and `replace_qualifier`.
Copilot AI lite review requested due to automatic review settings August 13, 2026 02:32
@github-actions github-actions Bot added logical-expr Logical plan and expressions common Related to common crate labels Aug 13, 2026

Copilot AI left a comment

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.

Pull request overview

This PR reduces the cost of deriving expression/projection schemas by (1) adding a lazily-built name→field-index accelerator to DFSchema to avoid linear scans during column resolution, and (2) avoiding duplicate resolution work in Expr::to_field for Expr::Alias by computing the inner field once and reusing its metadata.

Changes:

  • Add DFSchema::name_index (OnceLock<HashMap<String, Vec<usize>>>) and update name-based lookup helpers to consult it rather than scanning all fields.
  • Update Expr::to_field’s Expr::Alias handling to resolve the inner expression once and merge metadata from the resolved field.
  • Add unit tests ensuring the new name-indexed lookups match the previous linear-scan behavior and that the index remains derived state across schema operations.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
datafusion/expr/src/expr_schema.rs Avoids double schema/expr traversal in Expr::Alias by reusing the resolved inner field and its metadata.
datafusion/common/src/dfschema.rs Adds a lazy name→indices cache for faster column lookup and adjusts trait impls/tests to keep behavior stable.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +119 to 123
/// Lazily built accelerator for name lookups: maps a field name to the
/// ascending list of indices carrying it. Purely derived from `inner`, so
/// it takes no part in equality or `Debug`.
name_index: OnceLock<HashMap<String, Vec<usize>>>,
}
@codecov-commenter

codecov-commenter commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.41860% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.15%. Comparing base (3985bd5) to head (cea1b11).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
datafusion/common/src/dfschema.rs 99.40% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #24316    +/-   ##
========================================
  Coverage   81.14%   81.15%            
========================================
  Files        1110     1110            
  Lines      386168   386323   +155     
  Branches   386168   386323   +155     
========================================
+ Hits       313368   313517   +149     
- Misses      54343    54347     +4     
- Partials    18457    18459     +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

`merge` is the one method that mutates a `DFSchema` in place, replacing
`inner` and extending `field_qualifiers`. A name index built before the
merge kept describing the old field set, so every field merged in was
invisible to later lookups: `index_of_column_by_name` returned `None` for
them and `qualified_fields_with_unqualified_name` left them out.

Drop the index at the end of `merge` and let the next lookup rebuild it.

`name_index_survives_merge` covers it, comparing against the linear-scan
reference after a merge that both adds a new name and reuses an existing
one under a different qualifier. It fails without this change.
@zhuqi-lucas

Copy link
Copy Markdown
Contributor Author

run benchmark sql_planner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c5275628469-1573-p87gh 6.12.85+ #1 SMP Wed Jun 17 20:31:55 UTC 2026 aarch64 GNU/Linux

CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected

Comparing dfschema-name-index (cea1b11) to 3985bd5 (merge-base) diff

Run configuration
run benchmark sql_planner

Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

Comparing dfschema-name-index (cea1b11) to 3985bd5 (merge-base) diff

Run configuration
run benchmark sql_planner
CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected
Details

group                                                 HEAD                                   dfschema-name-index
-----                                                 ----                                   -------------------
logical_aggregate_with_join                           1.00    449.8±1.40µs        ? ?/sec    1.24    557.0±3.67µs        ? ?/sec
logical_correlated_subquery_exists                    1.00    281.6±1.03µs        ? ?/sec    1.27    358.3±2.79µs        ? ?/sec
logical_correlated_subquery_in                        1.00    283.3±0.53µs        ? ?/sec    1.27    360.6±1.93µs        ? ?/sec
logical_distinct_many_columns                         1.00    564.9±0.82µs        ? ?/sec    1.00    566.1±1.05µs        ? ?/sec
logical_join_4_with_agg_and_filter                    1.00    254.9±1.13µs        ? ?/sec    1.01    258.3±1.13µs        ? ?/sec
logical_join_8_with_agg_sort_limit                    1.00    422.2±2.53µs        ? ?/sec    1.04    440.8±2.11µs        ? ?/sec
logical_join_chain_16                                 1.00    670.2±3.38µs        ? ?/sec    1.10    739.2±3.77µs        ? ?/sec
logical_join_chain_4                                  1.00    123.4±0.61µs        ? ?/sec    1.04    128.4±0.54µs        ? ?/sec
logical_join_chain_8                                  1.00    249.2±1.47µs        ? ?/sec    1.08    268.8±1.18µs        ? ?/sec
logical_multiple_subqueries                           1.00    513.7±2.01µs        ? ?/sec    1.26    645.7±2.95µs        ? ?/sec
logical_nested_cte_4_levels                           1.00    260.1±1.00µs        ? ?/sec    1.09    283.9±1.05µs        ? ?/sec
logical_plan_struct_join_agg_sort                     1.01    179.0±0.85µs        ? ?/sec    1.00    176.6±0.93µs        ? ?/sec
logical_plan_tpcds_all                                1.00     93.5±0.19ms        ? ?/sec    1.03     96.5±0.23ms        ? ?/sec
logical_plan_tpch_all                                 1.02      6.6±0.02ms        ? ?/sec    1.00      6.5±0.02ms        ? ?/sec
logical_scalar_subquery                               1.00    305.6±1.35µs        ? ?/sec    1.27    387.2±2.14µs        ? ?/sec
logical_select_all_from_1000                          1.03    103.7±0.49ms        ? ?/sec    1.00    100.9±0.46ms        ? ?/sec
logical_select_one_from_700                           1.00    324.6±1.88µs        ? ?/sec    1.26    409.5±6.92µs        ? ?/sec
logical_trivial_join_high_numbered_columns            1.00    283.0±0.94µs        ? ?/sec    1.12    315.8±3.04µs        ? ?/sec
logical_trivial_join_low_numbered_columns             1.00    271.1±0.76µs        ? ?/sec    1.16    314.2±3.40µs        ? ?/sec
logical_union_4_branches                              1.00    421.8±0.91µs        ? ?/sec    1.25    526.6±2.02µs        ? ?/sec
logical_union_8_branches                              1.00    805.6±2.23µs        ? ?/sec    1.26   1015.8±6.26µs        ? ?/sec
logical_wide_aggregate_100_exprs                      1.01      4.5±0.01ms        ? ?/sec    1.00      4.5±0.01ms        ? ?/sec
logical_wide_case_50_exprs                            1.15      2.4±0.00ms        ? ?/sec    1.00      2.1±0.00ms        ? ?/sec
logical_wide_filter_200_predicates                    1.15   1309.0±7.18µs        ? ?/sec    1.00   1137.0±6.34µs        ? ?/sec
logical_wide_filter_50_predicates                     1.00    389.9±2.23µs        ? ?/sec    1.01    395.0±1.96µs        ? ?/sec
optimizer_correlated_exists                           1.00    244.2±1.06µs        ? ?/sec    1.12    273.1±1.20µs        ? ?/sec
optimizer_join_4_with_agg_filter                      1.00    493.8±1.87µs        ? ?/sec    1.02    501.7±2.16µs        ? ?/sec
optimizer_join_chain_4                                1.00    184.4±0.46µs        ? ?/sec    1.06    195.6±0.39µs        ? ?/sec
optimizer_join_chain_8                                1.00    569.0±1.57µs        ? ?/sec    1.11    632.2±1.50µs        ? ?/sec
optimizer_select_all_from_1000                        3.07      7.1±0.02ms        ? ?/sec    1.00      2.3±0.01ms        ? ?/sec
optimizer_select_one_from_700                         1.00    252.1±0.48µs        ? ?/sec    1.01    255.7±1.25µs        ? ?/sec
optimizer_tpcds_all                                   1.00    314.6±0.48ms        ? ?/sec    1.08    339.5±0.32ms        ? ?/sec
optimizer_tpch_all                                    1.00     17.9±0.04ms        ? ?/sec    1.02     18.2±0.04ms        ? ?/sec
optimizer_wide_aggregate_100                          1.03      2.3±0.01ms        ? ?/sec    1.00      2.2±0.00ms        ? ?/sec
optimizer_wide_filter_200                             1.28      3.7±0.01ms        ? ?/sec    1.00      2.9±0.01ms        ? ?/sec
physical_intersection                                 1.00    596.7±1.48µs        ? ?/sec    1.10    658.9±2.77µs        ? ?/sec
physical_join_consider_sort                           1.00   1044.8±3.91µs        ? ?/sec    1.28   1337.9±2.30µs        ? ?/sec
physical_join_distinct                                1.00    264.0±0.90µs        ? ?/sec    1.18    310.7±3.27µs        ? ?/sec
physical_many_self_joins                              1.00      7.6±0.02ms        ? ?/sec    1.08      8.2±0.02ms        ? ?/sec
physical_plan_clickbench_all                          1.01    131.9±0.51ms        ? ?/sec    1.00    130.9±0.88ms        ? ?/sec
physical_plan_clickbench_q1                           1.04   1439.3±9.49µs        ? ?/sec    1.00  1383.5±10.49µs        ? ?/sec
physical_plan_clickbench_q10                          1.00      2.1±0.01ms        ? ?/sec    1.03      2.2±0.01ms        ? ?/sec
physical_plan_clickbench_q11                          1.00      2.2±0.01ms        ? ?/sec    1.03      2.3±0.01ms        ? ?/sec
physical_plan_clickbench_q12                          1.00      2.3±0.01ms        ? ?/sec    1.02      2.4±0.01ms        ? ?/sec
physical_plan_clickbench_q13                          1.00      2.1±0.01ms        ? ?/sec    1.01      2.1±0.01ms        ? ?/sec
physical_plan_clickbench_q14                          1.00      2.2±0.01ms        ? ?/sec    1.02      2.3±0.01ms        ? ?/sec
physical_plan_clickbench_q15                          1.00      2.1±0.01ms        ? ?/sec    1.02      2.2±0.01ms        ? ?/sec
physical_plan_clickbench_q16                          1.01   1839.4±5.84µs        ? ?/sec    1.00   1829.7±8.10µs        ? ?/sec
physical_plan_clickbench_q17                          1.00   1891.8±8.06µs        ? ?/sec    1.01   1913.8±7.11µs        ? ?/sec
physical_plan_clickbench_q18                          1.00   1722.7±6.17µs        ? ?/sec    1.01   1740.9±7.53µs        ? ?/sec
physical_plan_clickbench_q19                          1.01      2.2±0.02ms        ? ?/sec    1.00      2.1±0.01ms        ? ?/sec
physical_plan_clickbench_q2                           1.00   1790.8±7.49µs        ? ?/sec    1.02   1817.8±7.16µs        ? ?/sec
physical_plan_clickbench_q20                          1.00   1569.7±6.04µs        ? ?/sec    1.01   1592.5±9.29µs        ? ?/sec
physical_plan_clickbench_q21                          1.00  1791.5±11.95µs        ? ?/sec    1.02   1823.5±9.21µs        ? ?/sec
physical_plan_clickbench_q22                          1.00      2.2±0.01ms        ? ?/sec    1.04      2.3±0.02ms        ? ?/sec
physical_plan_clickbench_q23                          1.00      2.4±0.03ms        ? ?/sec    1.03      2.5±0.01ms        ? ?/sec
physical_plan_clickbench_q24                          1.02      6.8±0.04ms        ? ?/sec    1.00      6.6±0.01ms        ? ?/sec
physical_plan_clickbench_q25                          1.00  1934.0±11.80µs        ? ?/sec    1.01   1956.9±7.27µs        ? ?/sec
physical_plan_clickbench_q26                          1.00   1758.8±7.26µs        ? ?/sec    1.03   1813.8±9.09µs        ? ?/sec
physical_plan_clickbench_q27                          1.00  1959.7±12.07µs        ? ?/sec    1.03      2.0±0.01ms        ? ?/sec
physical_plan_clickbench_q28                          1.00      2.4±0.01ms        ? ?/sec    1.04      2.4±0.01ms        ? ?/sec
physical_plan_clickbench_q29                          1.00      2.5±0.01ms        ? ?/sec    1.03      2.6±0.01ms        ? ?/sec
physical_plan_clickbench_q3                           1.00   1716.0±6.75µs        ? ?/sec    1.00   1717.4±7.28µs        ? ?/sec
physical_plan_clickbench_q30                          1.09     15.9±0.06ms        ? ?/sec    1.00     14.5±0.08ms        ? ?/sec
physical_plan_clickbench_q31                          1.00      2.6±0.02ms        ? ?/sec    1.00      2.6±0.01ms        ? ?/sec
physical_plan_clickbench_q32                          1.00      2.6±0.01ms        ? ?/sec    1.00      2.6±0.01ms        ? ?/sec
physical_plan_clickbench_q33                          1.00      2.1±0.01ms        ? ?/sec    1.01      2.1±0.01ms        ? ?/sec
physical_plan_clickbench_q34                          1.00   1856.3±5.43µs        ? ?/sec    1.00   1861.3±8.25µs        ? ?/sec
physical_plan_clickbench_q35                          1.00  1887.2±10.42µs        ? ?/sec    1.01   1908.0±7.27µs        ? ?/sec
physical_plan_clickbench_q36                          1.00      2.2±0.01ms        ? ?/sec    1.01      2.2±0.01ms        ? ?/sec
physical_plan_clickbench_q37                          1.00      2.6±0.01ms        ? ?/sec    1.02      2.6±0.01ms        ? ?/sec
physical_plan_clickbench_q38                          1.00      2.6±0.01ms        ? ?/sec    1.02      2.6±0.01ms        ? ?/sec
physical_plan_clickbench_q39                          1.00      2.6±0.01ms        ? ?/sec    1.02      2.7±0.01ms        ? ?/sec
physical_plan_clickbench_q4                           1.00   1519.6±5.84µs        ? ?/sec    1.00   1522.4±8.09µs        ? ?/sec
physical_plan_clickbench_q40                          1.00      3.4±0.01ms        ? ?/sec    1.02      3.4±0.01ms        ? ?/sec
physical_plan_clickbench_q41                          1.00      2.9±0.01ms        ? ?/sec    1.01      2.9±0.01ms        ? ?/sec
physical_plan_clickbench_q42                          1.00      3.1±0.01ms        ? ?/sec    1.03      3.2±0.01ms        ? ?/sec
physical_plan_clickbench_q43                          1.00      3.2±0.01ms        ? ?/sec    1.02      3.3±0.02ms        ? ?/sec
physical_plan_clickbench_q44                          1.00   1588.9±6.54µs        ? ?/sec    1.02  1614.6±25.08µs        ? ?/sec
physical_plan_clickbench_q45                          1.00   1593.9±6.55µs        ? ?/sec    1.01  1612.4±11.10µs        ? ?/sec
physical_plan_clickbench_q46                          1.00   1911.1±6.75µs        ? ?/sec    1.01   1934.7±6.68µs        ? ?/sec
physical_plan_clickbench_q47                          1.00      2.6±0.01ms        ? ?/sec    1.01      2.7±0.01ms        ? ?/sec
physical_plan_clickbench_q48                          1.00      2.8±0.01ms        ? ?/sec    1.02      2.9±0.01ms        ? ?/sec
physical_plan_clickbench_q49                          1.00      2.9±0.01ms        ? ?/sec    1.01      2.9±0.01ms        ? ?/sec
physical_plan_clickbench_q5                           1.00   1648.5±8.73µs        ? ?/sec    1.01   1670.0±7.35µs        ? ?/sec
physical_plan_clickbench_q50                          1.02      2.7±0.01ms        ? ?/sec    1.00      2.7±0.01ms        ? ?/sec
physical_plan_clickbench_q51                          1.00      2.1±0.01ms        ? ?/sec    1.01      2.1±0.01ms        ? ?/sec
physical_plan_clickbench_q6                           1.00  1653.6±11.95µs        ? ?/sec    1.01   1673.6±8.08µs        ? ?/sec
physical_plan_clickbench_q7                           1.00   1467.2±7.79µs        ? ?/sec    1.02   1496.8±6.66µs        ? ?/sec
physical_plan_clickbench_q8                           1.00   1972.2±9.38µs        ? ?/sec    1.02      2.0±0.01ms        ? ?/sec
physical_plan_clickbench_q9                           1.00   1989.4±9.22µs        ? ?/sec    1.02      2.0±0.01ms        ? ?/sec
physical_plan_struct_join_agg_sort                    1.00   1353.7±3.11µs        ? ?/sec    1.00   1347.4±2.37µs        ? ?/sec
physical_plan_tpcds_all                               1.00    743.1±5.49ms        ? ?/sec    1.02    760.9±4.07ms        ? ?/sec
physical_plan_tpch_all                                1.01     46.6±0.28ms        ? ?/sec    1.00     46.4±0.11ms        ? ?/sec
physical_plan_tpch_q1                                 1.05   1609.8±2.19µs        ? ?/sec    1.00   1528.5±2.59µs        ? ?/sec
physical_plan_tpch_q10                                1.01      2.9±0.01ms        ? ?/sec    1.00      2.9±0.00ms        ? ?/sec
physical_plan_tpch_q11                                1.00      2.3±0.01ms        ? ?/sec    1.01      2.4±0.00ms        ? ?/sec
physical_plan_tpch_q12                                1.00   1297.4±2.56µs        ? ?/sec    1.01   1310.4±2.48µs        ? ?/sec
physical_plan_tpch_q13                                1.00   1068.2±1.85µs        ? ?/sec    1.02   1088.3±3.33µs        ? ?/sec
physical_plan_tpch_q14                                1.09   1468.9±3.52µs        ? ?/sec    1.00   1352.9±3.68µs        ? ?/sec
physical_plan_tpch_q16                                1.00   1662.8±2.92µs        ? ?/sec    1.02   1694.7±3.00µs        ? ?/sec
physical_plan_tpch_q17                                1.00   1719.7±3.17µs        ? ?/sec    1.03   1769.0±3.52µs        ? ?/sec
physical_plan_tpch_q18                                1.00      2.0±0.01ms        ? ?/sec    1.06      2.1±0.00ms        ? ?/sec
physical_plan_tpch_q19                                1.02   1956.1±5.69µs        ? ?/sec    1.00   1921.3±3.56µs        ? ?/sec
physical_plan_tpch_q2                                 1.00      3.7±0.01ms        ? ?/sec    1.03      3.9±0.01ms        ? ?/sec
physical_plan_tpch_q20                                1.00      2.2±0.00ms        ? ?/sec    1.03      2.3±0.00ms        ? ?/sec
physical_plan_tpch_q21                                1.00      2.9±0.00ms        ? ?/sec    1.04      3.0±0.00ms        ? ?/sec
physical_plan_tpch_q22                                1.00   1534.1±3.56µs        ? ?/sec    1.00   1534.9±3.58µs        ? ?/sec
physical_plan_tpch_q3                                 1.03   1961.6±6.99µs        ? ?/sec    1.00   1905.9±3.23µs        ? ?/sec
physical_plan_tpch_q4                                 1.02   1264.1±4.47µs        ? ?/sec    1.00   1236.9±4.03µs        ? ?/sec
physical_plan_tpch_q5                                 1.00      2.9±0.01ms        ? ?/sec    1.00      2.8±0.00ms        ? ?/sec
physical_plan_tpch_q6                                 1.06    667.4±1.61µs        ? ?/sec    1.00    631.5±1.55µs        ? ?/sec
physical_plan_tpch_q7                                 1.00      2.9±0.01ms        ? ?/sec    1.00      2.9±0.00ms        ? ?/sec
physical_plan_tpch_q8                                 1.00      4.0±0.01ms        ? ?/sec    1.01      4.0±0.01ms        ? ?/sec
physical_plan_tpch_q9                                 1.00      2.8±0.00ms        ? ?/sec    1.00      2.8±0.00ms        ? ?/sec
physical_select_aggregates_from_200                   1.11     15.6±0.04ms        ? ?/sec    1.00     14.0±0.03ms        ? ?/sec
physical_select_all_from_1000                         1.10    115.1±0.24ms        ? ?/sec    1.00    105.1±0.23ms        ? ?/sec
physical_select_one_from_700                          1.00    766.3±6.02µs        ? ?/sec    1.12    855.6±3.84µs        ? ?/sec
physical_sorted_union_order_by_10_int64               1.00      4.4±0.01ms        ? ?/sec    1.00      4.4±0.01ms        ? ?/sec
physical_sorted_union_order_by_10_uint64              1.00      9.3±0.01ms        ? ?/sec    1.01      9.3±0.02ms        ? ?/sec
physical_sorted_union_order_by_50_int64               1.04    106.8±0.45ms        ? ?/sec    1.00    103.0±0.37ms        ? ?/sec
physical_sorted_union_order_by_50_uint64              1.02    414.5±1.79ms        ? ?/sec    1.00    405.2±1.50ms        ? ?/sec
physical_theta_join_consider_sort                     1.00   1069.4±3.65µs        ? ?/sec    1.27   1360.7±4.06µs        ? ?/sec
physical_unnest_to_join                               1.00    633.9±1.60µs        ? ?/sec    1.14    721.9±6.27µs        ? ?/sec
physical_window_function_partition_by_12_on_values    1.01    723.7±3.51µs        ? ?/sec    1.00    717.3±2.42µs        ? ?/sec
physical_window_function_partition_by_30_on_values    1.00   1427.2±1.38µs        ? ?/sec    1.01   1437.0±3.27µs        ? ?/sec
physical_window_function_partition_by_4_on_values     1.02    446.7±1.49µs        ? ?/sec    1.00    437.7±2.03µs        ? ?/sec
physical_window_function_partition_by_7_on_values     1.01    547.5±1.46µs        ? ?/sec    1.00    540.0±1.38µs        ? ?/sec
physical_window_function_partition_by_8_on_values     1.02    588.5±5.64µs        ? ?/sec    1.00    579.0±2.01µs        ? ?/sec
with_param_values_many_columns                        1.33    433.8±1.74µs        ? ?/sec    1.00    325.6±2.25µs        ? ?/sec

Resource Usage

sql_planner — base (merge-base)

Metric Value
Wall time 2475.5s
Peak memory 129.3 MiB
Avg memory 63.6 MiB
CPU user 1886.1s
CPU sys 1.4s
Peak spill 0 B

sql_planner — branch

Metric Value
Wall time 2480.5s
Peak memory 142.7 MiB
Avg memory 69.2 MiB
CPU user 1896.0s
CPU sys 1.3s
Peak spill 0 B

File an issue against this benchmark runner

@zhuqi-lucas
zhuqi-lucas marked this pull request as draft August 13, 2026 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Related to common crate logical-expr Logical plan and expressions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants