Repository navigation
Description
Parent Issue
Detail of Subtask
Evidence reassessment — 2026-10-26
Current delivery/performance status: DESIGN/VALIDATION OPEN. The plan/work-count observation remains useful; no producer-reuse-only production speedup has been demonstrated.
Observed: Pinned Q15 has two MO LINEITEM/revenue producers; DuckDB materializes one common producer and filters winning revenue before wide supplier fetch. A historical RANK rewrite changes MO SF100 from 10.592 to 5.945 s, but changes reuse, filter placement and sorting together.
Not yet established: How much each separate transformation saves on current main and when sharing costs more memory, synchronization or startup than recomputation.
Next discriminating experiment: Rebaseline the unchanged create-view/SELECT/drop-view lifecycle. Compare existing reuse eligibility and work counts, then isolate reuse-only and early-filter variants before combining them. Include materialization and consumer wait costs.
Measured target: One eligible expensive producer and reduced wide materialization for unchanged Q15-shaped SQL, followed by query CPU/latency and full-suite acceptance.
Mandatory controls and total cost boundary: Ties, empty/NULL aggregates, volatile or merely similar producers, selective/unselective consumers, tiny input, memory pressure and cancellation/early stop.
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
- The unchanged Q15-shaped SQL produces one eligible expensive revenue producer, with native work counts demonstrating reuse.
- Independent small tests cover ties, empty inputs, NULL aggregate/scalar-subquery behavior, volatile expressions and view lifetime.
- Reused state has explicit ownership, memory accounting and release on completion, error, cancellation and operator reuse.
- Report separate reuse-only/filter-placement controls where feasible, then warmed Q15 latency/CPU and the full-suite effect; preserve an ineligible/cost-negative fallback.
Describe implementation you've considered
Extend existing deterministic producer reuse where an equivalent eligible plan is missed. Evaluate early winner filtering separately. Keep recomputation or existing inlining when sharing is cost-negative; no new general materialization framework without need.
Coordination: Coordinate with #30857 but do not equate repeated identical producers with grouped-measure reuse through joins.
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