Repository navigation
Description
Parent Issue
Detail of Subtask
Q1 direct-lookup follow-up — 2026-11-04
#32097 is now ready for review; it already bypasses generic hashing for eligible all-hit chunks after warm-up and uses dense group-ID addressing for small decimal SUM/AVG states. This task remains the owner of further small-domain grouping work; no duplicate issue or competing grouping mechanism is needed. Preserve prior implementation and rejected-prototype history below.
First priority: simplify the existing lookup. In the frozen combined SF100 RAM Q1 profile, previewCompactGroups is 5.64% of exclusive CPU samples. The current two-column path clears chunk codes, scans each column to construct them, then scans codes to fetch IDs. That is a measured remaining leaf; its entire cost is not necessarily removable.
- Diagnose remaining generic hashing before designing a replacement: compare
GroupCompactLookupRowswith grouping input rows per operator, and inspectPreviewInsert/hash call paths. Use a separate bounded diagnostic, not benchmark result/data verification. - Evaluate a one-pass two-column lookup: read both eligible CHAR values, apply the existing canonicalization, and address
ids[a * 257 + b]directly into chunk group IDs. Remove successful-path temporary-code writes/reads when possible; retain one-column support and cheap unsupported routes. - Preserve complete SQL key identity: empty and PAD SPACE values, embedded zero, high bytes, Unicode/collation restrictions, NULL/constant/grouping/source metadata, malformed/non-inline representations and domain expansion. No hard-coded TPC-H letters, observed four-group assumption, query IDs or cardinality guess.
- Preserve all-hit versus miss behavior. No partially filled scratch can escape on fallback; successful IDs must reference committed current-generation groups. Keep memory accounting, publication, capacity refusal, reset/spill/rebuild and cancellation contracts. Use deterministic owning tests with independent expected semantics, not large fixtures.
- Measure full dispatch/canonicalization/lookup work and instructions plus end-to-end Q1; include a second small-domain workload and tiny/unsupported/high-NDV controls. Do not claim a gain from one faster inner loop.
Conditional later work: direct-address group creation. Proceed only if the diagnostic proves meaningful generic hashing remains after the lookup improvement. The bounded 257×257 array may own key-to-dense-ID lookup/discovery, but requires an approved design for non-mutating preview, capacity/aggregate/output-key preflight, publication, output identity, generic transition, spill and generation teardown. A failed reservation must not leave published IDs or duplicate aggregate input on retry. Avoid allocating dense aggregate state for every possible key: the array maps possible keys to observed dense group IDs. Keep existing allocation budgets and spill representation; no extra cache tier or query-specific path. If startup-only hashing is negligible, record that result and leave full replacement unimplemented.
Evidence: SF100 combined profile and individually compressed recordings, frozen combined source bb80939a27d68195924c6fbcad711e58e9f57fc6. It contains #32093/#32097/#32098; these samples identify executed work, not an independent attribution or a speedup forecast. Independent #32097 acceptance uses current main dbf3efd4b5864216d32cfe95bc5a09690e9b4f72. Do not add historical percentages to claim removable wall time.
For these follow-ups, the requester’s 2026-11-04 readiness criterion is no confirmed affected-query/control/Total regression; a confirmed speedup is not mandatory. Report work reduction, query wall times and uncertainty separately. An unresolved slower signal requires independent confirmation and is not a pass. Preserve existing correctness/resource gates. Compare one candidate at a time against clean main with identical builds/configuration, all available CPUs, cold runs excluded, profiles separate from latency scoring, full Q1–Q22 tables and a Total row. Cover applicable SF10/SF100 RAM and disk modes; any SF100 spilling invalidates the run. Scripts execute/drain only, with no input/schema/table/row/result/reference/checksum verification. Server129 timing is explicitly deferred while unrelated jobs run; do not start it or stop those jobs. No code implementation is authorized by this tracking update.
Current candidate — 2026-10-30
Sizing-only PR #31779 is updated at 12989b6117, separately from scan-filter work. Performance captures pin d8fa09e406; the subsequent commit only repairs the shared reconnect SQL fixture, with unchanged production service source/native inputs. It hoists CHAR/Unicode sizing while preserving the existing encoders and numeric shortcuts. The historical rejected prototype below is not the source in that PR.
The original Q11/NULL review confirmations are complete. Five qualified final-source A/A/B component triplets show ordinary CHAR−5.85%, nullable−20.08%, grouping−20.00%, all-NULL−10.16% and constant−3.85%; empty is inconclusive, with0B/op and0alloc/op throughout. Final independent Q11 confirmation estimates−1.07% (interval−2.52% to+0.13%), so the earlier slower signal did not reproduce.
The ordinary full Q1–Q22 screen retained three qualified pairs, but build inspection found different make-derived release metadata between detached-main and PR builds. It is observational, not a source-only acceptance result. Q3's ordinary follow-up+3.10% remains visible. Rebuilding both revisions with identical release metadata and matching hash seed gives a separate Q3 estimate+0.38% (interval−0.69% to+2.04%); the earlier slower signal does not reproduce in that controlled comparison. This does not prove metadata alone caused it. Profiles/seed/A/A/release-metadata diagnostics remain separate and disclose all limits.
The owning hashmap tests, affected grouping consumers and final full pre-push SCA pass. Fresh CI and external review apply to the newly pushed head. Broad performance acceptance and issue closure remain open: an attributable Q1 benefit, the full matched-release comparison and applicable SF100/mixed-I/O evidence are not established by these scoped repairs. All acceptance checkboxes below remain unchanged.
Full raw timings, SQL, source/executable identities, profile summary and exclusions.
Evidence reassessment — 2026-10-26
Historical prototype status: LOCAL CANDIDATE REJECTED; that prototype produced no PR. CHAR preparation candidate f9a1cb7c46 versus main 289d58b independently reproduces constant +2.10%, grouping +1.61% and empty +25.99% component slowdowns. These do not establish whole-query regressions, and targeted encoding gains do not clear acceptance.
Observed: Historical Q1 produces four observed grouping identities. fillStringGroupStr is 3.63% of SF10 and 3.00% of SF100 exclusive user samples, with stacks through Group -> PreviewInsert -> encodeHashKeys. This entire leaf is not necessarily removable or exclusively the proposed CHAR specialization.
Not yet established: The current cost split between canonicalization, sizing/encoding, hashing, lookup and aggregate state. Four observed groups do not prove a four-value SQL key domain, and a faster synthetic CHAR loop does not establish an end-to-end gain.
Next discriminating experiment: Measure current Q1 actual key representations/byte lengths, complete-key identity and work per 256-row call. Separate sizing, encoding, hashing and lookup. Compare existing dispatch with specialization setup/rejection included, and isolate the constant/grouping regressions instead of guessing their instruction-level cause.
Measured target: Unchanged Q1 plus a second generic small-domain grouping workload, with reduced attributable key/state work and latency.
Mandatory controls and total cost boundary: Constant, grouping-set, empty/tiny, Unicode/PAD SPACE, nullable/composite keys, high NDV, skew and domain expansion. Preserve cheap unsupported routes and admission/rollback.
Performance acceptance and rejection
- Freeze current-main/candidate sources, executables, real caller shapes and effective settings. Use the unchanged qualification SQL and complete result consumption; exclude cold runs and keep profiles separate from latency scoring.
- Demonstrate the named work/CPU reduction and an attributable uninstrumented target-query improvement. Include the controls below and full Q1-Q22 comparison; component wins, source changes, functional tests, SCA, merging and profile percentages are separate evidence.
- A confirmed affected/control slowdown fails; unresolved slower signals are inconclusive. Confirm with an independent longer balanced run. No gain elsewhere, favorable average or self-approved tolerance waives a regression.
- Complete applicable SF10/SF100 and memory/mixed-I/O acceptance before issue closure under the umbrella protocol. Report uncertainty, absolute CPU/instructions/work, allocations/copies and the same whole-application budget, effective cache, I/O/spill/swap/pressure evidence. Benchmark scripts do not verify input/table/schema/row counts/reference results/checksums.
Semantics and lifecycle requirements retained
- A reviewed design defines complete-key identity, domain-bound proof, memory bound and fallback; it does not allocate from an untrusted maximum without admission.
- Focused tests cover nullable/composite/constant keys, boundary domains, collisions where applicable, domain expansion and generic fallback.
- Demonstrate reduced key/state work for Q1 and a second generic small-domain workload; report high-cardinality negative controls.
- Keep the task separate from canonical hash transport/reuse in [Enhancement]: Reuse canonical grouping hashes across shuffle and aggregation #27753 and preserve aggregation cleanup, reset and cancellation contracts.
Describe implementation you've considered
Evaluate reuse of existing type/codec selection at an appropriate setup boundary, compact canonical keys, or bounded direct addressing only with a complete domain/equality/memory proof. Prefer the cheapest demonstrated option; no extra dictionary or per-batch eligibility scan without an amortized benefit.
Coordination: Reuse canonical hash work in #27753. Keep key representation separate from #30847 updates and #30859 physical-order eligibility.
Additional information
- Reassessed profile/caller evidence and delivery ledger.
- Historical MO source
873282742714436bff407dfcdbbe879147162bd3; DuckDB069cc9f9b5be802405797faecc284961b07c70ef. SF10 all-query profiles; SF100 results/profiles; mixed-I/O evidence. These are pinned historical captures, not current-main scores. - No new query/benchmark was run for this reassessment. Foreground query work, engine background maintenance, kernel CPU and off-CPU waits must be distinguished; all remain inside whole-application resource accounting.
Pinned implementation / plan references
Activity
[-][Subtask]: Use compact grouping keys and bounded aggregation for proven small domains[/-][+][Subtask]: Reduce grouping-key and state cost for proven small domains[/+]aunjgr commentedon Oct 29, 2026
Canonicalization-dispatch candidate: corrected implementation, qualification pending
The scoped design hoists string/CHAR canonicalization choice out of row loops, preserves exact key framing and allocation/publication order, and introduces no iterator cache or domain-size assumption. Local corrected commit:
0af0832248f9a2bb9c43b8fd74c87db2c4b25103(not pushed; no PR yet).The initial prototype improved ordinary CHAR preparation but did not meet the control gate: its first matched A/A/B screen showed empty +12.49%, grouping +3.41% and nullable +1.36% slower signals. Ordinary flag-shaped preparation was −41.37%; that gain does not waive the slower controls. These are component measurements, not TPC-H regressions.
Generated code showed the common sizing frame grew from 232 to 264 bytes. The corrected implementation avoids copying the type descriptor, factors column sizing, and skips zero-row work only after retaining input validation. Its common sizing frame is back to 232 bytes. This is a concrete setup-cost correction, not proof that every earlier slower signal had that cause.
The corrected source passes the hashmap owning package, existing grouping consumers, independent binary framing/PAD SPACE/Unicode tests, package-graph verification, scoped default SCA and the fast repository convention guard. Current-source component timing retained three complete A/A/B triplets before unrelated Cargo/Rust compilation interrupted the next triplet. That entire incomplete triplet is excluded. The remaining matched groups and any necessary regression confirmation must finish before SQL timing and PR publication. No accepted current-source no-regression or TPC-H claim is made.
Both baseline labels use the same executable and matched fixtures. Measurements are local; first component samples are excluded. Failed and superseded variants remain separately recorded under
build/cache-scan-group-wave-20261029; results from different implementations are not pooled. The broader issue remains open.aunjgr commentedon Oct 29, 2026
Post-cache CHAR candidate: local SF10 Q1–Q22 screen
The candidate is isolated from scan-filter work and compared with main
ee8b20692e560a54ef18fddbb439b875dc0b52c2, containing merged cache fix #31767. Candidateed1114adde65f4ec8440f111287d6f648e113e33changes only CHAR key preparation/encoding and its tests relative to that main. It preserves runtime checks; no production rule assumes TPC-H has no NULLs.Four balanced process pairs completed, with three measured warm calls/query after excluding the cold run. Normal Go1.27.1 SIMD/v3 builds, eight application CPUs, effective16GiB cache and32GiB whole-app budget. Resource-invalid whole attempts were excluded; accepted samples were not filtered. All retained arms passed the declared physical-I/O, spill, swap, OOM, pressure and CPU/compiler gates. The benchmark executes/drains without input/schema/table/row/reference/result/checksum verification.
Q1's paired estimate is3.30% lower but inconclusive. Q9/Q17 have faster intervals in this screen. Q11 has a slower signal (+1.25%,95% interval +0.78% to +2.44%) requiring independent confirmation; it has not been declared harmless or a confirmed causal regression. Higher Q7/Q8/Q20 point estimates remain inconclusive. Gains elsewhere do not waive a confirmed regression.
The current-source component screen retained three A/A/B groups showing approximately41% less time on ordinary flat CHAR preparation, with roughly1% slower NULL-control signals. The longer independent control attempt was interrupted by external CPU/build activity, so that incomplete triplet is excluded. These control signals and Q11 confirmation remain open before merging. Functional/grouping tests pass; full pre-push SCA is being finalized. This report is performance evidence with explicit uncertainty, not a blanket acceptance PASS or broader issue closure.
aunjgr commentedon Oct 30, 2026
CHAR sizing dispatch: review repair and local evidence
Candidate
d8fa09e406b74a905516dd2b5b1f3f1f44c90641versus maind39d8a40343ccd40bf665036388df7a40ee867f8. This is the final numeric-dispatch correction, isolated from #31785. The encoder is unchanged.The revision limits specialization to exact canonical sizing. CHAR/Unicode codec selection happens once per column while retaining per-row NULL/GROUPING domain precedence. Uniform non-null constant widths are accumulated once with fixed widths before the existing buffer admission. No new cache, iterator state, API, key format or memory limit is introduced.
Component controls in the production build mode
Six balanced A/A/B triplets were requested; retained qualified triplets are listed in the raw data below. They completed with identical baseline ELF for A/A, identical fixtures, Go1.27.1 SIMD/v3 and production function alignment64. CPU8, GOMAXPROCS1/test.cpu1. Two 500ms samples/case; the first is discarded. Resource-invalid triplets are excluded in full. All retained CPU/build checks passed.
These component controls use the final numeric-dispatch correction. No component has a slower signal. Empty-route variation is comparable to the same-binary control and is not claimed as an attributable gain. The abandoned encoder variants and differently linked unit-benchmark variants are not pooled into this result.
Full warm SF10 Q1–Q22 screen
3 qualified balanced process pairs [1, 2, 3]; three measured warm calls/query after excluding the cold call. Effective16GiB CN cache,32GiB whole-application budget, eight physical CPUs8–15. Normal uninstrumented service builds, SIMD/v3/alignment64. Benchmark scripts execute/drain only: no input/schema/table/row/reference/result/checksum verification.
Intervals are paired process-level bootstrap estimates for four or more pairs; smaller samples display the observed pair range and remain limited evidence. A faster aggregate never offsets a confirmed slower query/control.
Earlier review concerns and provenance
The independent Q11 run on the preceding published head
ed1114adde65versusee8b20692ecompleted four qualified balanced pairs with96 warm calls/query. Its estimate was−0.66%, interval−1.11% to+0.22%, so the original+1.25% slowdown did not reproduce. This historical Q11 check is separate from the revised-head full screen above.The earlier NULL-control rejection counted its own key benchmark as external CPU because the executable exclusion prefix pointed at the wrong directory. That failed attempt remains excluded. The new control harness uses the actual executable prefix and records the full CPU/build window. No threshold was relaxed.
The full hashmap owning package, existing grouping consumers and the extended four-row mixed domain/constant test pass. That test verifies CHAR/Unicode identities, NULL/GROUPING precedence and exact80-byte binary-collation buffer admission. Broader issue #30841 and SF100/mixed-I/O acceptance remain open.
Raw qualified component medians (first/cold sample excluded)
Raw qualified full-query warm timings (seconds)
Independent confirmation of the screening signals
The preceding sizing-only revision
f6a86279bchad Q10/Q16/Q17/Q18 slower signals in a two-pair screen. A separate longer comparison retained two qualified pairs with12 warm calls/query: Q10 −0.02% (observed pair range −0.38% to+0.34%), Q16 −1.10% (−2.87% to+0.68%), Q17 −2.02% (−3.61% to−0.43%). Q18 remained slower at+2.11% (+0.24% to+3.98%). Those limited-sample ranges are not confidence intervals.Q18 prompted a further code correction: preserve the pre-existing numeric sizing shortcuts before testing canonical string specialization. This is included in final head
d8fa09e406; the intermediate negative was not accepted or offset by improvements elsewhere.The final Q18-only comparison completed four qualified balanced process pairs,24 warm calls/query after excluding the cold call. Baseline median 0.316870s; candidate median 0.314145s. Paired estimate -0.88%,95% paired interval -1.50% to -0.25%. All original resource, effective-cache, physical-I/O/spill/swap/OOM, pressure and CPU/compiler gates passed in all eight arms. The earlier slower signal did not reproduce on this correction.
Raw final Q18 warm calls (seconds)
Matched workload and exact executable identities
Unchanged SF10 TPC-H SQL from the existing qgen dataset is shared by both sides. Q11 uses GERMANY and the SF10 threshold0.0000100000. The independently confirmed Q11 workload was:
d39d8a40343ccd40bf665036388df7a40ee867f83174ddf9fba4101194f75dcad4f909bc3e7832bb101810bdfec723dfb58b9f9bd8fa09e406b74a905516dd2b5b1f3f1f44c906412a2d9497fe3ba35d45d5a1b3301e1a0521a5f887ac44c508d070b597bb19260ed39d8a40343ccd40bf665036388df7a40ee867f83174ddf9fba4101194f75dcad4f909bc3e7832bb101810bdfec723dfb58b9f9bd8fa09e406b74a905516dd2b5b1f3f1f44c906412a2d9497fe3ba35d45d5a1b3301e1a0521a5f887ac44c508d070b597bb19260eee8b20692e560a54ef18fddbb439b875dc0b52c284ca145251b48a9db4d3c70296197b9a299ff35d11519d51aee486928df2b70aed1114adde65f4ec8440f111287d6f648e113e335c415022ab27fed9699a1ba5e1129359f9e257da9a6497c8b6cf48b83a6b6e2aThe component fixture is identical across baseline and candidate; the A/A baseline executable is reused, and the candidate is rebuilt from final source with the same production SIMD/v3/alignment64 mode. Earlier encoder-specialized/default-linker variants remain excluded from these results. Broad issue acceptance, including an attributable Q1 benefit plus SF100/mixed-I/O evidence, remains open. No issue-closure or blanket performance PASS is claimed.
Final independent Q3/Q11/Q19 confirmation and Q3 causality checks
Four qualified balanced pairs used32 warm calls/query after the cold call, on final source
d8fa09e406versus maind39d8a4034. The ordinary randomized-seed comparison retains Q3 +3.10% (+0.46% to+4.73% percentile bootstrap interval). Q11 is−1.07% (−2.52% to+0.13%) and Q19−0.21% (−0.56% to+1.94%); their screen slowdowns did not reproduce. These four-pair percentile intervals are limited small-sample estimates.The Q3 timing difference was investigated rather than waived. A separate128-call CPU profile has about41% of user samples in unchanged Int64HashMap.FindBatch. Whole-app CPU is161.476s versus162.435s, user cycles841.501B versus840.237B, and instructions1621.385B versus1622.656B. The changed string-sizing helper is below the0.3% report threshold. The dominant integer lookup instruction sequence and symbol targets match after normalizing data relocations; raw code bytes differ in relocation displacement. Profiling is separate from latency scoring: both profile arms had4KiB physical writes and are excluded from strict all-memory timing acceptance.
MO initializes process-local hash keys through math/rand. Matching that seed with GODEBUG=randautoseed=0 reduced the Q3 paired difference to+0.69% (+0.13% to+1.45%). A same-baseline-ELF/same-seed A/A calibration estimates−0.04% (−0.47% to+0.45%). These are separate diagnostics, not pooled into the ordinary benchmark or claimed as a regression tolerance.
Build inspection also found a concrete mismatch: the detached baseline had empty make-derived release metadata and reported v1.3.0, while the PR branch-derived version reported only v. Thus the earlier normal-build comparison is not a source-only experiment. Both source revisions were rebuilt with identical release metadata: MO_VERSION=v1.3.0, BRANCH_NAME=benchmark, LAST_COMMIT_ID=benchmark, BUILD_TIME=1793340000. The normal Go1.27.1 SIMD/v3/alignment64 and native build settings are retained; actual source revisions remain in Go buildvcs and artifact manifests.
With matching release metadata and hash seed, Q3 is +0.38% and its interval includes both directions. The earlier+3.10% observation is retained above; it is not attributed solely to this source change. This does not prove that metadata alone caused it, and does not establish broad issue acceptance. The original Q11/NULL review confirmations are complete; the broader Q1/SF100/mixed-I/O gates remain open.
Raw warm timings for independent confirmations and diagnostic controls (seconds)
perf(hashmap): hoist canonical string key sizing (#31779)
perf(group): reuse compact group IDs and dense decimal states (#32097)
aunjgr commentedon Nov 16, 2026
Follow-on implementation: #32817. This fused compact-lookup delta is separate from the earlier merged CHAR canonicalization/sizing work. The older comments retain their historical source pins; the new all-query campaign and diagnostics are below. Issue requirements are unchanged.
Conclusion: fused compact lookup
Q1 user instructions fall 3.38%/3.39%/2.22% in SF10 memory/SF10 disk/SF100 disk;
Q1 wall changes -1.91%/-.26%/-3.52%. The original Total wall deltas are
+1.11%/+3.17%/-2.90%. The positive SF10 values and slower controls remain in
the primary tables; they are not replaced with favorable diagnostics.
The implementation removes duplicate descriptor/code traversals without adding
an allocation, payload copy, derived-index owner or lifecycle. Reused actual
caller-shape controls save33.31% instructions/35.88% cycles for 256-row two-column
hits. All18 shapes and inlining were checked on the identical feature code and
relevant component inputs. The explicitly approved tiny one-row miss/unsupported
setup cost (~8 instructions,2–3cycles, zero allocation increase) remains visible
in the design decision and is not extended to another waiver.
Investigating the SF10 slower signals
Primary SF10 disk Q3/Q5/Q12 wall medians were +10.35%/+14.60%/+17.61%, with almost
unchanged estimated non-GC instructions. A separate UNSCORED all22 replay used
main -> compact -> the identical main ELF, adding TLB/cache counters (100%
hardware running). It is not pooled with qualification or used to overwrite any
primary result.
Identical-main Q12 varies10.1%; compact lies between. Q3/Q5 primary slowdowns do
not reproduce. CPI/TLB/cache data demonstrate process-level stall variation; the
probe does not prove a unique hardware cause for every original wait. Together
with unchanged control-query work, source/component review and target instruction
wins, no stable introduced penalty was confirmed. Whole-window Go allocated bytes
change +.085%/+.542%/-.090% in the three primary modes; these include common
scrape/background work and are not intrinsic per-query allocation-size claims.
Measurement scope
Main at capture start,
8e8708a8d306a69512d140b40bfcfebc1d404a32, which includes thefile-service revert, is the reference. Every arm is isolated; no pending allocator
or other optimization PR is included. Go1.27.1, SIMD/v3, function alignment64 and
matching native artifacts/release metadata are used. THP stays enabled with its
existing host policy; no VM policy or preconditioning is added.
One process per arm/configuration, one excluded cold Q1–Q22 suite followed by five
profiled warm full suites. All32 CPUs, 48GiB application/aggregate/join thresholds,
16GiB shared cache. Spill/swap/OOM and compiler/excess external-CPU interference
invalidate a capture. Two compact SF100 attempts overlapped Cargo and are retained
wholly excluded; no partial sample was pooled. The automated quiet resume reused
completed configurations. Benchmark SQL is executed/drained without checking
input/table/schema/row/reference-result/checksum contents.
Primary timings include GC and instrumentation. Total sums per-query medians;
no GC-subtracted wall time or independent-process confidence bound is claimed.
Native per-query counters publish asynchronously; the tables preserve their
limits. No globally exact copy-byte counter exists. Single-host/process evidence
cannot establish every-workload or population noninferiority.
Exact service pins
8e8708a8d306a69512d140b40bfcfebc1d404a32e50cd32c7844c2074d56aabbd8c20c07f32627d294286668dd1e231a89b63b067181ef4d29aaf50fbf116169187dd98f1e13a476b8d2e1b8ce96ccc3933d548c398e952b230edb2700fb8174aeaf56346ae04e0419ca2f1d0a8fc802cc331b8f7da3f382177bff739e338eb777e288702e269d20b1e4543a4043113a3a6bf4bf71de120f937e4002sf10-memory: all 22 queries, Total, CPU, instructions and allocations
Allocation counters include common process/scrape and asynchronous engine work. No globally exact copy-byte counter is available. GC CPU is measured process GC CPU, not a wall-time subtraction.
| Query | Main Go MB | Candidate Go MB | Go bytes Δ | Main Go objects | Candidate Go objects | Main GC CPU s | Candidate GC CPU s |
|---|---:|---:|---:|---:|---:|---:|---:|---:|
| 1 | 53.084 | 53.174 | +0.17% | 380858 | 398365 | 0.0000 | 0.0000 |
| 2 | 35.001 | 22.892 | -34.59% | 355925 | 301179 | 0.0000 | 0.0000 |
| 3 | 37.245 | 39.840 | +6.97% | 454717 | 463610 | 0.0000 | 0.0000 |
| 4 | 38.364 | 38.514 | +0.39% | 332364 | 330559 | 0.0000 | 0.0000 |
| 5 | 62.934 | 50.136 | -20.34% | 467834 | 433905 | 0.2210 | 0.0000 |
| 6 | 38.499 | 39.549 | +2.73% | 240494 | 283032 | 0.0000 | 0.0000 |
| 7 | 53.243 | 52.634 | -1.14% | 409656 | 407730 | 0.0000 | 0.0000 |
| 8 | 284.415 | 282.136 | -0.80% | 2416905 | 2403726 | 0.2974 | 0.3561 |
| 9 | 153.107 | 152.860 | -0.16% | 2454638 | 2448362 | 0.1918 | 0.2069 |
| 10 | 60.399 | 59.709 | -1.14% | 797448 | 774704 | 0.0000 | 0.0000 |
| 11 | 31.715 | 31.009 | -2.23% | 538175 | 534614 | 0.0000 | 0.0000 |
| 12 | 51.046 | 49.692 | -2.65% | 387770 | 382217 | 0.0000 | 0.0000 |
| 13 | 866.696 | 865.968 | -0.08% | 15293140 | 15314452 | 0.7167 | 0.6738 |
| 14 | 47.718 | 46.875 | -1.77% | 1009411 | 1013061 | 0.0000 | 0.0000 |
| 15 | 57.032 | 55.623 | -2.47% | 670423 | 653738 | 0.0000 | 0.0000 |
| 16 | 39.455 | 39.234 | -0.56% | 652012 | 660394 | 0.0000 | 0.0000 |
| 17 | 78.841 | 78.876 | +0.04% | 537313 | 527657 | 0.2146 | 0.2299 |
| 18 | 43.579 | 44.171 | +1.36% | 372414 | 372644 | 0.0000 | 0.0000 |
| 19 | 72.620 | 70.657 | -2.70% | 590994 | 578985 | 0.0000 | 0.0000 |
| 20 | 129.643 | 130.027 | +0.30% | 2378804 | 2379729 | 0.2127 | 0.2081 |
| 21 | 93.914 | 97.273 | +3.58% | 650130 | 678498 | 0.0000 | 0.0000 |
| 22 | 23.775 | 21.814 | -8.25% | 254990 | 232817 | 0.0000 | 0.0000 |
| Total | 2352.326 | 2322.662 | -1.26% | 31646415 | 31573978 | 1.8542 | 1.6748 |
Native allocation attribution limit: the default allocator publishes counters after a 100 ms window; MPool publishes after a one-second window. Their query-boundary increments are retained in raw JSON, but can belong to neighboring queries. They are not exact per-query allocation evidence and are not used to declare a per-query allocation pass. IO/cache counters overlap the default allocator and must not be added again. Long-window native totals also have endpoint lag; exact per-query native costs need separate operator/component evidence.
Faults/system CPU/read bytes belong to the measured application. THP fallback counts are host-wide supporting evidence; they neither automatically invalidate a result nor excuse an introduced resource regression.
Whole-warm peak GiB: main 20.843, candidate 21.154.
External process cores: main 0.442, candidate 0.387; interrupt cores separately: 0.355, 0.351.
GC attribution uses period-weighted instruction samples; non-GC figures are estimates, not exact foreground counters. Raw hardware instructions are above.
sf10-disk: all 22 queries, Total, CPU, instructions and allocations
Allocation counters include common process/scrape and asynchronous engine work. No globally exact copy-byte counter is available. GC CPU is measured process GC CPU, not a wall-time subtraction.
| Query | Main Go MB | Candidate Go MB | Go bytes Δ | Main Go objects | Candidate Go objects | Main GC CPU s | Candidate GC CPU s |
|---|---:|---:|---:|---:|---:|---:|---:|---:|
| 1 | 53.311 | 53.827 | +0.97% | 389193 | 404914 | 0.0000 | 0.0000 |
| 2 | 24.387 | 22.553 | -7.52% | 324302 | 298996 | 0.0000 | 0.0000 |
| 3 | 37.416 | 36.791 | -1.67% | 443405 | 448382 | 0.0000 | 0.0000 |
| 4 | 38.177 | 38.042 | -0.35% | 332261 | 322790 | 0.0000 | 0.0000 |
| 5 | 50.013 | 52.771 | +5.51% | 423472 | 427911 | 0.0000 | 0.0000 |
| 6 | 52.622 | 53.095 | +0.90% | 296198 | 295728 | 0.2004 | 0.2338 |
| 7 | 52.395 | 51.829 | -1.08% | 402642 | 393157 | 0.0000 | 0.0000 |
| 8 | 285.416 | 283.606 | -0.63% | 2417426 | 2406282 | 0.2990 | 0.3284 |
| 9 | 152.431 | 151.774 | -0.43% | 2448441 | 2444353 | 0.0000 | 0.1940 |
| 10 | 62.458 | 60.271 | -3.50% | 778893 | 781680 | 0.0000 | 0.0000 |
| 11 | 31.075 | 32.197 | +3.61% | 525749 | 549560 | 0.0000 | 0.0000 |
| 12 | 49.327 | 60.646 | +22.95% | 380860 | 424032 | 0.0000 | 0.1854 |
| 13 | 864.229 | 868.027 | +0.44% | 15307493 | 15304374 | 0.6292 | 0.6627 |
| 14 | 49.433 | 48.165 | -2.57% | 1035634 | 1022595 | 0.0000 | 0.0000 |
| 15 | 64.901 | 54.117 | -16.62% | 722255 | 637318 | 0.0000 | 0.0000 |
| 16 | 39.459 | 40.102 | +1.63% | 668359 | 667631 | 0.0000 | 0.0000 |
| 17 | 79.946 | 68.414 | -14.43% | 519175 | 518903 | 0.2093 | 0.0000 |
| 18 | 53.700 | 43.614 | -18.78% | 413435 | 364522 | 0.0000 | 0.0000 |
| 19 | 71.321 | 70.063 | -1.76% | 583507 | 570022 | 0.0000 | 0.0000 |
| 20 | 126.967 | 130.690 | +2.93% | 2358312 | 2384873 | 0.1890 | 0.2143 |
| 21 | 95.359 | 99.351 | +4.19% | 673108 | 683123 | 0.0000 | 0.0000 |
| 22 | 21.597 | 21.081 | -2.39% | 231100 | 217866 | 0.0000 | 0.0000 |
| Total | 2355.943 | 2341.025 | -0.63% | 31675220 | 31569012 | 1.5269 | 1.8186 |
Native allocation attribution limit: the default allocator publishes counters after a 100 ms window; MPool publishes after a one-second window. Their query-boundary increments are retained in raw JSON, but can belong to neighboring queries. They are not exact per-query allocation evidence and are not used to declare a per-query allocation pass. IO/cache counters overlap the default allocator and must not be added again. Long-window native totals also have endpoint lag; exact per-query native costs need separate operator/component evidence.
Faults/system CPU/read bytes belong to the measured application. THP fallback counts are host-wide supporting evidence; they neither automatically invalidate a result nor excuse an introduced resource regression.
Whole-warm peak GiB: main 15.510, candidate 15.189.
External process cores: main 0.425, candidate 0.441; interrupt cores separately: 0.351, 0.342.
GC attribution uses period-weighted instruction samples; non-GC figures are estimates, not exact foreground counters. Raw hardware instructions are above.
sf100-disk: all 22 queries, Total, CPU, instructions and allocations
Allocation counters include common process/scrape and asynchronous engine work. No globally exact copy-byte counter is available. GC CPU is measured process GC CPU, not a wall-time subtraction.
| Query | Main Go MB | Candidate Go MB | Go bytes Δ | Main Go objects | Candidate Go objects | Main GC CPU s | Candidate GC CPU s |
|---|---:|---:|---:|---:|---:|---:|---:|---:|
| 1 | 809.919 | 801.557 | -1.03% | 7673573 | 7649872 | 0.5375 | 0.4996 |
| 2 | 164.058 | 161.988 | -1.26% | 2070665 | 2078338 | 0.0000 | 0.0000 |
| 3 | 546.566 | 548.155 | +0.29% | 6702849 | 6732535 | 0.4762 | 0.4668 |
| 4 | 530.791 | 530.795 | +0.00% | 5130311 | 5077547 | 0.0000 | 0.4827 |
| 5 | 608.633 | 595.713 | -2.12% | 5818255 | 5692572 | 0.5865 | 0.0000 |
| 6 | 507.050 | 520.862 | +2.72% | 3953776 | 3981157 | 0.4489 | 0.4371 |
| 7 | 707.831 | 703.083 | -0.67% | 6514005 | 6467097 | 0.4764 | 0.4253 |
| 8 | 1056.896 | 1060.871 | +0.38% | 9440382 | 9427995 | 0.5503 | 0.5883 |
| 9 | 1703.960 | 1707.627 | +0.22% | 27772588 | 27731026 | 1.0240 | 1.0240 |
| 10 | 737.047 | 736.707 | -0.05% | 9741861 | 9739944 | 0.5024 | 0.4925 |
| 11 | 241.171 | 239.598 | -0.65% | 4168351 | 4168759 | 0.0000 | 0.0000 |
| 12 | 727.800 | 717.328 | -1.44% | 7098115 | 7005622 | 0.0000 | 0.5322 |
| 13 | 8467.333 | 8476.805 | +0.11% | 151563814 | 151598520 | 4.6997 | 4.3461 |
| 14 | 579.029 | 570.315 | -1.50% | 11716821 | 11678386 | 0.0000 | 0.0000 |
| 15 | 838.320 | 839.268 | +0.11% | 10306200 | 10275938 | 0.4717 | 0.4815 |
| 16 | 227.157 | 223.320 | -1.69% | 4784878 | 4745715 | 0.0000 | 0.0000 |
| 17 | 834.765 | 832.011 | -0.33% | 7668068 | 7675231 | 0.4539 | 0.5025 |
| 18 | 824.520 | 827.642 | +0.38% | 7451487 | 7457214 | 0.5066 | 0.5168 |
| 19 | 937.666 | 938.454 | +0.08% | 8925475 | 8926039 | 0.4812 | 0.4849 |
| 20 | 1303.275 | 1298.532 | -0.36% | 25109687 | 25148118 | 0.4982 | 0.5806 |
| 21 | 1475.196 | 1476.570 | +0.09% | 13988428 | 13980619 | 0.5382 | 0.5292 |
| 22 | 79.478 | 78.638 | -1.06% | 798771 | 800530 | 0.0000 | 0.0000 |
| Total | 23908.459 | 23885.839 | -0.09% | 338398360 | 338038774 | 12.2516 | 12.3901 |
Native allocation attribution limit: the default allocator publishes counters after a 100 ms window; MPool publishes after a one-second window. Their query-boundary increments are retained in raw JSON, but can belong to neighboring queries. They are not exact per-query allocation evidence and are not used to declare a per-query allocation pass. IO/cache counters overlap the default allocator and must not be added again. Long-window native totals also have endpoint lag; exact per-query native costs need separate operator/component evidence.
Faults/system CPU/read bytes belong to the measured application. THP fallback counts are host-wide supporting evidence; they neither automatically invalidate a result nor excuse an introduced resource regression.
Whole-warm peak GiB: main 31.195, candidate 30.937.
External process cores: main 0.791, candidate 0.494; interrupt cores separately: 0.627, 0.610.
GC attribution uses period-weighted instruction samples; non-GC figures are estimates, not exact foreground counters. Raw hardware instructions are above.
All five primary warm wall times for every query
sf10-memory
sf10-disk
sf100-disk
Final delivery merge
After these captures, #32800 merged grouped-measure reuse into main. The delivery
branch merges that authoritative base. Compact lookup, its relevant typed/component
inputs and Q1 admission/data flow are unchanged. #32800 targets repeated grouped
SUM across qualifying joins (Q18); Q1 has no such repeated aggregate. These
measurements remain pinned to their exact main/compact ELFs above, with no claim
that a different delivery-head binary produced them. Static checks run again on
the merged head; the unchanged functional/component evidence is reused.
Main subsequently also merged #32815 allocator advice and qualified-identifier
parser fixes. Compact lookup, its declared sizes, allocation/copy layout and
key/publication contract are unchanged. The final group owning package is run
under the new common allocator policy, followed by the complete static gate.
The timings above remain measurements of the explicitly pinned pre-merge ELFs;
no new delivery-head timing is claimed.
perf(group): fuse two-column compact lookups (#32817)
XuPeng-SH commentedon Nov 17, 2026
已合入 main,交 QA 验证;不是验收通过,也不关闭本项或父项 #30838。
关联 PR #32817,merge SHA
28ffd6ae678744b6ff68bc239daefe9ad9ac1325(2026-11-17 10:22 UTC),head276473d5e5d3dfa8308a99ebd7b119d2163d2896。本次融合 eligible 两列 flat CHAR(1) 的 descriptor/code/committed group lookup,复用既有 compact index 和 scratch;保持 generic preview/commit、key identity、admission、spill/reset/generation。单行走既有 common route,没有新增 direct-address group creation 或 aggregate-state 机制。已有证据与限制:作者记录 owning group 测试及静态检查通过,复用 18 个实际 caller-shape 控制;256 行两列 hit 的组件指令/周期减少 33.31%/35.88%,不等于 SQL 加速。设计保留已接受的单行 miss/unsupported 固定开销约 8 条指令、2–3 cycles,未增加分配。review 对历史
b395d893f5为 APPROVED:production decoder 177,801 案例和 257 个 domain identity 等价探针通过,核对三配置全部 22 查询/Total,并复用冻结 CI 成功;review 未重跑完整 native/package/SQL 测试,未取得作者/CI 原始执行日志。合并队列报告 CI Required 通过。性能报告固定于 main
8e8708a8d306a69512d140b40bfcfebc1d404a32/ compact19ca2f1d0a8fc802cc331b8f7da3f382177bff73,SF10 memory/disk、SF100 disk 各每臂一个进程,排除一轮 cold 后五轮 profiled warm。Q1 指令变化 -3.38%/-3.39%/-2.22%,wall -1.91%/-0.26%/-3.52%;Total wall +1.11%/+3.17%/-2.90%,保留原始慢信号,不用其他收益抵消。独立未计分 main/compact/同一 main ELF replay 未确认稳定引入的控制查询惩罚,但不能证明总体非劣性,也不替代未插桩、独立进程复测。之后共同 allocator/base 变更不在这些性能捕获中;最终 merge SHA 未由本轮独立实测。基准仅执行/消费 SQL,不验证输入/表/行数/参考结果;异步 native allocation 计数不能作精确每查询归因。QA 建议:在实际验收版本复核完整 CHAR/PAD SPACE/empty/NUL/high bytes/NULL、constant/grouping metadata、unsupported/长值、offset/tail、miss 后 fallback 与 domain 扩展;保留 admission refusal、publication、spill/reset/cancel/generation 边界及 tiny/high-NDV/第二小域工作负载。按本项原性能门槛重测完整 Q1–Q22/Total、适用 SF10/SF100 RAM/磁盘与资源边界,独立复核 SF10 原慢信号,不将组件收益或合并视作全面性能通过。现有评论未留下当前适用的已验证反例或明确未完成开发 follow-up,改交 Ariznawlll;条件式进一步建组机制不因本次交接自动实现或宣称已交付。
Ariznawlll commentedon Nov 18, 2026
Note
QA 补充验证:大数据量真机基准已实测(main
517e169538)。compact group path 在真数据上运行正常;白盒全过。保持 OPEN。QA 补充:真机验证结果(#30841 grouping-key 两列融合 #32817)
白盒(本构建)
pkg/sql/colexec/group全包:PASS(7.3s,含TestCompactTupleLookupScratchAndOffsets、TestCompactGroupCanonicalKeysAndSpill、TestCompactGroupFallbackAndGeneration、TestCompactGroupAdmissionFailure等 compact fusion 全套)+group包定向 spill 相关全过。pkg/sql/colexec/...聚合相关 12+ 包全 ok。真数据(800k partsupp ⋈ 200k part,CHAR(10) 两列分组)
group by p_brand, p_container+ count/sum:best=0.016s(约 30 万分组,150 组+'),compact 路径健康无 fallback 异常、无 panic。结论
Ariznawlll commentedon Nov 25, 2026
结论
测试不通过。2026-11-25 在本轮冻结的最新 main 上,完整 compact lookup dispatch 的单列、小批量及 unsupported 控制路径确认变慢。双列大批量命中有收益,但不能抵消该 Issue 要求保留的控制路径回退。本结论限定为组件性能,不表示已证实 TPC-H 查询或 Total 回退。
关键证据
main@ca5325ce683a60ef6d7f0888b68d709de2ea8389。隔离编译并启动独立 1 LOG/1 TN/1 CN,git_version()实测返回完整相同 SHA;组件测试独立记录构建来源。28ffd6ae678744b6ff68bc239daefe9ad9ac1325。对照 B 为当前 main 上的 QA-only scoped counterfactualfeca02edb6bd5fc3d5744ff5ec05e3a2c01928b1:只移除previewCompactGroups内len(vecs)==2 && count>1调用previewFlatTuple的三行 dispatch,保留当前 generic fallback、其余实现及编译优化。它不是历史 release,也不是整个 PR 的反向归因。A0/A1/B全排列各一次,A0/A1 使用同一官方 ELF;各形状每进程两次 2 秒,明确丢弃第一次、保留第二次。Go 1.27.1 linux/amd64,GOAMD64=v3、GOEXPERIMENT=simd、-funcalign=64,CPU48、GOMAXPROCS=1、相同 8 GiB SDK 配额。使用独占入场租约;1803 次监测均有租约、foreign MO=0、host OOM kill 计数始终 41,未在计时期间装载或编译其他 MO。sqrt(A0*A1)/B计算配对 log ratio;下表区间为对全部 18 形状 Bonferroni 校正的同时 95% 区间(df=5,临界值 5.47145054),正值表示官方 A 较慢。没有用有利均值抵消控制回退。同 ELF A/A 各形状估计绝对值最大 0.897%,校正区间均跨零;这只是稳定性对照,不宣称等效性证明。[A0,A1,B],六组分别来自六个独立排列块,可直接重算主要回退:0 B/op, 0 allocs/op。当前 group owning tests 225 个顶层测试 ×3=675 次 PASS。这些证明覆盖范围内的语义/生命周期,不等于性能通过。0e67f90816f7813080e79a976f8524e3a9981c34b763ae9b428bf3013a5410c1;B:e1b54aef257496b285bf21561a82d7012bf05030e03621fc698a1b8b7d0780ef。完整 raw、构建回执、全部形状分析和连续 host 监测保存于本次独立compact-components-confirmation-v2证据目录;上述原始值在评论内保留以便独立复核。待解决点