Repository navigation
Description
Is there an existing issue for the same feature request?
- I have checked the existing issues. [Subtask]: Attribute and reduce shuffle/join vector materialization cost #30845 covers attributed materialization cost and [Tech Request]: support read from cache without copy #16387 covers immutable cache references; neither specifies a general dictionary-vector representation and its engine consumers.
Is your feature request related to a problem?
The retained TPC-H captures show repeated vector gathers/copies around joins and shuffle. This issue tracks the approved engine representation work within #30838. Historical profiles motivate the work; no current-main speedup is claimed.
Describe the feature you'd like
Introduce engine-wide in-memory dictionary vectors over immutable flat/constant backing and accounted shared selections. Preserve logical values, NULL/grouping state and string/prepared-parameter metadata. Use explicit logical read views, copy-on-write and materialization boundaries so producers can avoid payload copies without exposing unsupported representations to legacy consumers.
Describe implementation you've considered
Approved seven-PR execution series:
- Replace perf(scan): apply complete local key domains before shuffle and probing #32098 with early complete-domain scan filtering, independently of dictionary vectors ([Subtask]: Reduce hash-join input with effective runtime filters and build/probe choices #30844).
- Dictionary representation, ownership, read views and accounting; no producer enabled.
- Explicit compatibility/normalization boundaries; no producer enabled.
- Dictionary-aware expression, join, aggregate and copy consumers; no producer enabled.
- Enable scan/filter/projection producers; primary target Q12.
- Enable shuffle and eligible join producers; primary target Q9.
- Integrate reader filtering and selected payload construction; primary target Q19.
Use existing leases where available, promote uniquely owned backing to shared immutable ownership, snapshot mutable metadata and account actual retained bytes until final release. Collapse nested dictionaries to one base mapping. Unknown/legacy ownership and unsupported consumers use explicit accounted materialization. Keep flat fast paths, existing SQL semantics and execution placement.
Documentation, Adoption, Use Case, Migration Strategy
Implementation begins with versioned design documents and a consumer/ownership matrix. The requester approved engine-wide scope and neutral infrastructure PRs on 2026-11-09. Producer-enabling changes require confirmed primary-query speedups; #32098 requires a confirmed Q9 speedup.
Persisted and transmitted vectors remain in the existing flat format. No SQL schema, cache-replacement algorithm or new cache tier is introduced. Q15 producer sharing, Q20 aggregation rewrites, codecs and additional decimal SIMD are outside this wave. No SF1000 qualification is required for this wave.
Additional information
- Parent optimization backlog: [Performance]: Optimize MO TPC-H execution from SF10/SF100 memory and mixed-I/O profiling #30838. Coordinated work: [Subtask]: Reduce hash-join input with effective runtime filters and build/probe choices #30844, [Subtask]: Attribute and reduce shuffle/join vector materialization cost #30845, [Subtask]: Reduce scan predicate materialization, repeated compaction and type-invariant decode work #30850.
- Compare one candidate with matching main; SF10/SF100 memory and disk, unchanged qualification Q1–Q22, cold full suites excluded and complete application budgets.
- Publish per-query wall/CPU/instructions and Total, retained-memory/work counters and uncertainty. No benchmark-time dataset or result verification.
- Five independent process pairs per profile; preserve raw intervals, Holm query checks and separate Total checks. Confirmed regressions block acceptance; an inconclusive gain is not a pass.
- Preserve raw datasets and final evidence. Remove only task-owned loaded images, temporary clones and RAM disks at terminal completion.
- Status: approved design/implementation work beginning; no implementation or performance acceptance claimed yet.
Activity
aunjgr commentedon Nov 8, 2026
The approved execution series now has a design-only PR #32380, version
adebe845cb4a77d97cf7dd0ae4b2efaf87dc224a: early runtime-filter domains and dictionary-vector execution.Implementation starts with replacing #32098's shuffle-only hook with complete domains from independent filtered scans. The engine-wide dictionary stages are tracked in #32379. Neutral foundations are allowed; producer enablement requires the predeclared target-query gain. SF10/SF100 qualification applies; Q15/Q20 rewrites and SF1000 are outside this wave. Existing issue descriptions and performance evidence remain unchanged. No new benchmark result is claimed.
aunjgr commentedon Nov 8, 2026
The dictionary stages now have templated s0 subtasks assigned to aunjgr:
PR1 remains the #32098 replacement under #30844. Design revision and delivery gates are in #32380. No implementation stage or performance gate is marked complete by creating these tasks.
aunjgr commentedon Nov 9, 2026
Dictionary representation/ownership foundation is now draft #32394 (subtask #32383), using the PR template. No dictionary SQL producers are enabled. Source-pinned SF10 all22 RAM/disk results are appended to the PR conversation; SF100 remains pending a quiet server129 window. The requester approved the early-filter admission amendment: keep the strict10% NDV threshold, evaluate completed source cardinality per target, and retain the64MiB cap. That replacement is being implemented in #32098. Dependent normalization/consumer/producer stages still wait for their prerequisite merge.
aunjgr commentedon Nov 9, 2026
Current implementation status:
db399919ca, with final-node identity remapping and the conservative unfiltered-probe consumer envelope. The broader and coalescing variants failed the all22 Q10 gate; their tables remain in comments and the buffering was removed. Latest owning tests/full pre-push pass, but fresh all22 latency qualification is still queued for compiler-free local CPUs. SF100 early timing remains disabled.docs: design early runtime filtering and dictionary vector execution (#…
aunjgr commentedon Nov 9, 2026
Series implementation update:
The merge-first restriction on draft development was unnecessary. Dependent source work can be drafted as a stack with explicit prerequisites. Qualification, production enablement and readiness remain isolated after prerequisite merges, under the existing acceptance rules. No producer speedup is claimed for neutral foundation PRs.
aunjgr commentedon Nov 9, 2026
#32098 update: current head
db399919capassed the complete local SF10 gate against main70952cb466: five independent pairs per RAM/disk profile, all Q1–Q22 plus Total, cold full suites excluded. Q9 wall time improves 10.81% in RAM (95% interval [-15.36%,-6.02%]) and 11.71% on warm disk ([-16.77%,-6.34%]). No Holm-confirmed query or separate-Total regression. Q10's current bypass is verified; neither profile establishes a Q10 regression. Total speedup remains inconclusive.Full wall/CPU tables and the source-pinned protocol are appended to #32098. SF100 remains required, and #32098 remains draft. No acceptance criterion was relaxed.
aunjgr commentedon Nov 9, 2026
Current series status: #32098 is ready after its declared SF10/SF100 Q9 and all-query/Total gates and green CI. #32394 is now ready after lease-backed ownership,480-byte header,77.89% local changed-code coverage, normal/race/static checks, both-scale neutral performance gates and fresh CI. SF100 tables: #32394 (comment). The boundary PR #32405 follows this accepted core; its readiness still requires the prerequisite merge and isolated acceptance. The remaining stages stay in scope: #32385 consumers, #32386 scan/filter/projection producers, #32387 shuffle/join producers and #32388 reader integration. No production dictionary producer is enabled.
feat(vector): add shared dictionary storage and row selections (#32394)
perf(scan): apply complete local key domains before shuffle and probi…
aunjgr commentedon Nov 10, 2026
Execution-plan audit: #32098 and #32394 are merged. #32405 is published as draft at
540e7aa80a; its revised SF10 neutral gate passes, while CI/SF100 continue independently in background.The four later stages are still undelivered: #32385 consumer migration has only a local worktree and no implementation PR; #32386 scan/filter/projection producers, #32387 shuffle/join producers and #32388 reader integration have not been implemented or submitted. I let #32405 acceptance work serialize the entire series, although the approved schedule permits stacked draft development. That was an execution gap, not a requirement to wait for prerequisite merges.
The work order remains consumer migration → scan/filter/projection producers (Q12) → shuffle/join producers (Q9) → reader integration (Q19), each in its own templated draft PR. The consumer worktree is now advanced to the current boundary parent. Draft development can proceed while #32405's checks run. Prerequisite merges, isolated performance acceptance and production enablement retain their existing gates. No delivered work or performance benefit is claimed for these four pending stages.
feat(vm): materialize dictionary batches for unsupported consumers (#…
aunjgr commentedon Nov 10, 2026
Implementation/protocol update — 2026-11-10
The requester approved combining #32385 and #32386 into one implementation PR. #32405 has merged; the local implementation was rebased onto main
00da05219f, excluding inherited prerequisite commits. #32387 (shuffle/join output views) and #32388 (deeper early filtering/late payload work) remain separate.The requester replaced the repeated-process acceptance protocol for this and future PRs:
Q12 remains the predeclared primary speedup target. Q1 is also in the scan-copy/aggregate-read validation scope: its filter is at scan, and dictionary-aware consumers must preserve that copy reduction rather than forcing immediate materialization. This does not replace #30841's small-domain grouping/hash work or #30847's aggregate update-cost work.
Local consumer, selected reader/tombstone, grouping, join, forwarding and account-lifecycle checks are passing. Performance acceptance and the implementation PR are still pending; no speedup or completion is claimed. Results will be appended in separate comments.
aunjgr commentedon Nov 10, 2026
Implementation is published as templated draft #32492, covering #32385/#32386.
The revised local SF10 memory qualification failed. Full Q1–Q22/Total results, allocation/profile diagnosis and proposed corrections are recorded separately from the PR description. Product code is frozen pending the requester's review; revised disk/SF100 checks have not run.
The current protocol is one process per build/configuration, one cold full22 suite excluded and five warm full22 suites profiled/accounted. Qualification is local SF10 memory/disk and local SF100 disk-backed, without spilling/swap/OOM or benchmark-time dataset/result verification. This replaces the older independent-process-pair/server129 wording; it does not weaken the regression gate.
aunjgr commentedon Nov 10, 2026
The ownership and private-header corrections are published in draft #32492, head
73930d6ace, on updated main1a12e18e68. Functional, race/account, SQL and static checks pass, but the current local SF10 memory qualification still fails the performance gate. Full all22/Total results and read-only diagnosis. Code is frozen pending requester review; disk/SF100 acceptance has not run. Earlier PR benchmark tables have been collapsed to avoid presenting them as current evidence.