Skip to content

[Subtask]: Design compact column encodings with encoding-aware filtering and aggregation #30858

Open

Description

@aunjgr

Parent Issue

#30838

Detail of Subtask

Evidence reassessment — 2026-10-26

Current delivery/performance status: LONGER-TERM DESIGN OPPORTUNITY; existing profiles do not choose a new encoding.

Observed: LZ4 remains visible with zero physical I/O, and pinned DuckDB code uses compact encodings in relevant paths. That establishes decode/representation work, not that all predicates execute without decoding or that another encoding is automatically cheaper. Current MO already has chunked-LZ4 support.

Not yet established: A current type/consumer envelope where retaining compact representation avoids more expansion/copy work than metadata, conversion and fallback cost.

Next discriminating experiment: Compare current LZ4/chunked decode, useful decoded reuse, selected-row decode and one compact representation on equal work. Measure actual expansion, metadata and consumer passes, not codec percentage alone.

Measured target: Lower decode/materialization CPU and target latency for the admitted Q1/Q6/Q12/Q19 subset within the total budget.

Mandatory controls and total cost boundary: High entropy, low reuse/selectivity, tiny batches, NULL/constant and boundary values, dictionary identity, invalid data and conversion/fallback paths.

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 selects one initial encoding/type/consumer envelope with measurable benefit, explicit ownership/bounds and fallback; no unmeasured general encoded-vector framework.
  • Inspect existing codecs, chunked decoding and consumer capabilities on current main before implementation; measure forced old/new paths on equivalent logical work.
  • Focused UT/BVT preserve NULL/constant values, signed/range boundaries, comparisons, decimal scale where eligible, selection/slicing, dictionary-domain identity and malformed-data checks.
  • Any persistent format change has a tested read/write capability contract; files/codecs outside the supported envelope use the existing path.
  • Report expanded/decoded values and bytes actually avoided, encoded metadata/conversion cost, CPU/instructions, peak accounted memory and warmed Q1/Q6/Q12/Q19 or the admitted subset. Include high-entropy and low-reuse controls.

Describe implementation you've considered

Start with one bounded integer/date/dictionary consumer using existing ownership and flat fallback. Consider persistent format changes only with an explicit compatibility/read/write design; do not introduce a general encoded-vector framework without a demonstrated consumer.

Coordination: #30849 cache reuse, #30850 selection, #30841 compact group keys and #16387 references must not double-count avoided expansion.

Additional information

Activity

  1. self-assigned this
    on Oct 22, 2026
  2. added
    severity/s0
    on Oct 22, 2026
  3. assigned and unassigned on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/subtaskseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions