Repository navigation
Description
Parent Issue
Detail of Subtask
Current status — 2026-10-31: admission change reverted
PR #31767 merged on 2026-10-29 and was intentionally reverted by #31943 on 2026-10-31 following the reported 25.7% TPC-H 1T slowdown in #31868. The rollback restores the prior reader cutoff and its constructor callers. The rollback did not rerun the reported 1T workload or establish its precise slowdown mechanism.
Current main 1565fb79ab again sets SkipMemoryCacheWrites after the per-reader threshold (128 for eight readers). New warm SF10 Q18/Q20 profiles show foreground/operator LZ4 decode despite the metric-verified 16 GiB SHARED CN cache; occupancy remains about 393–412 MiB. These captures are diagnostic-only because unrelated LLVM/LTO activity failed the host CPU/compiler gates. No current latency comparison or regression percentage is claimed.
The earlier #31767 measurements below are historical pre-revert evidence. They do not establish current-main cache admission or acceptance. Keep the broader issue open: a replacement must demonstrate bounded admission and scan-pollution behavior at larger workloads as well as warm-query benefit. Do not simply reapply the reverted change or enlarge the configured cache to bypass its policy.
Implementation PR — 2026-10-29
PR #31767 is open and ready for review (not draft). It removes the reader block-count admission cutoff and preserves explicit caller policies and the existing cache’s S3-FIFO, physical reservations, pressure and lease ownership. Owning/consumer/race validation, scoped static checks and the full final pre-push SCA passed.
Five retained local SF10 paired processes cover Q1–Q22 at the same effective 16 GiB cache and 32 GiB whole-application budget. Q6/Q12 improve about 48% and Q19 about 50%; no query has a slower confidence interval in those retained pairs. The originally planned sixth pair was interrupted by host activity, and separate CPU profiles are still pending. Neither is claimed complete. The PR can be reviewed with these explicit limits; the broader issue remains open for its remaining optimization and SF100/mixed-I/O acceptance.
Retained timing table, exclusions and resource evidence.
Implementation result — 2026-10-28
Bounded current-main diagnosis confirms that the fixed reader admission cutoff disables cache writes for 6,292 Q6 blocks, causing 25,168 warm column reconstructions despite a 16 GiB cache with only about 243.5 MiB logical occupancy. Next production design: budget-aware admission with scan-pollution controls using existing cache owners. No cache production patch in this diagnostic slice.
Detailed measurements and decision.
Evidence reassessment — 2026-10-26
Current delivery/performance status: DIAGNOSIS/OPTIMIZATION OPEN. #30884 added attribution, not decoded reuse. Merged #30971 removes its always-on overhead and reports isolated local SF10 acceptance. That old instrumentation regression is corrected; the broader cache/decode/copy goal remains open.
Observed: All-memory LZ4 CPU persists despite zero physical I/O. New SF100 Q9 callchain attribution places 2.71% of all user samples, about 65.76% of memmove leaf weight, under objectio.copyCachedVector. This demonstrates active decoded-cache materialization in that capture, not universal cache bypass. A 192 GiB capacity and an unscored 29.17 GiB occupancy sample are not scored hit/reuse evidence.
Not yet established: Which columns/keys are decoded again, which hits copy into owned output, useful reuse distance and lease lifetime. rchar is not a decoded-byte/cache-miss counter. The conservative 115.57 GiB decoded footprint plus 85.84 GiB image already exceeds 200 GiB before workspace.
Next discriminating experiment: Attribute cache lookup/admission, reconstruction, hit copying and scan selection separately on current main. Record bounded diagnostic work/byte counters outside scored timing; quantify avoided decodes versus merely shifted copies, real occupancy and total charged residency.
Measured target: Unchanged Q6/Q9/Q10/Q19 as applicable: reduce repeated decode or hit-copy cost and target latency within the same image/cache/workspace budget.
Mandatory controls and total cost boundary: Cold/one-pass/low-reuse columns, selective reads, compressed/uncompressed construction, rejected admission, pressure/eviction, early stop and retained leases. Ordinary diagnostic-disabled paths must not acquire unconditional counter/context work.
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
- Identify the active cache key, admission threshold, hit/miss and decode ownership for the target workload; no branch attribution from rchar alone.
- Report actual occupancy, hit/admission/decode counts, CPU, logical reads and physical I/O; demonstrate less repeated decode work in warmed Q6/Q10/Q19.
- The selected path stays within the whole-application cap including native image, cache and workspaces, with explicit immutable-buffer release/reset behavior.
- Include selective and one-pass negative controls; retain bounded behavior under pressure without unbounded cache growth.
Describe implementation you've considered
Compare existing owned copies, selection/search while an entry is pinned, useful admission changes, and existing #16387 immutable references where lifetime is proven. A read-only alias still needs an owner and release; a larger configured cache or new zero-copy framework is not the default answer.
Coordination: #30848 owns encoded pages; #30850 selection; #30845 attributed materialization. Preserve #16387 ownership rather than inventing competing reference lifetimes.
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.
- Raw SF100 Q9 recording and exact ELF/reanalysis index. Retain callgraphs when using
perf script;-Ghides them.
Pinned implementation / plan references
Activity
perf(storage): attribute column cache admission and reconstruction (#…
XuPeng-SH commentedon Oct 22, 2026
QA follow-up after PR #30884 merged (2026-10-22; merge commit
67109ee23d66abe929b7cfa1c61f02b39bf54eb9, PR headd1418abc9c14b3f4ad28bb07952b1f9f40aeba0c): this change adds bounded cache-admission/reconstruction attribution counters and atomic live counter reporting; it explicitly does not change cache admission/reuse policy. Therefore it provides diagnostic instrumentation for this subtask, but does not by itself satisfy the broader reuse/admission acceptance criteria here.The formal approval was submitted against earlier head
83075e850d3613553db4ad8c6f6f5844f0872328. Its review reports focused package/race tests passed and records the FileService suite timeout plus skipped opt-in OOM/RSS tests. These are reviewer-reported results; I did not rerun them. GitHub returned no combined status checks or PR-triggered workflow runs for the merge commit. The local workspace has no MatrixOne checkout or Go executable, so I could not run the merged head.Issue remains open and assigned to aunjgr; no completion or tester handoff is claimed.
[-][Subtask]: Improve decoded-column cache admission and reuse within the application budget[/-][+][Subtask]: Reduce measured decoded-cache reconstruction and copy cost within budget[/+]aunjgr commentedon Oct 28, 2026
Current-main decoded-cache diagnosis: admission cutoff confirmed
Main
6d1f5d7f2d31b119f201986f0bf6f9c7f2e78d89, local SF10, CPUs0–7, explicit 16 GiB SHARED memory cache and 32 GiB whole-application limit, native image in RAM. The measured arms had zero physical reads/writes, spill, swap, OOM and sustained pressure. Cold runs were excluded. Normal CPU profiles and temporary bounded diagnostics were separate; no input/schema/row/result/checksum verification was performed.The important remaining cause is a reader admission policy, even though the configured cache has ample free capacity.
GetThresholdForReader(8)returns 128. Inreader.Read, oncereadBlockCnt > threshHold, the reader addsSkipMemoryCacheWrites. It continues to read existing cache entries, but stops admitting later decoded columns.One independent diagnostic warm Q6 execution directly recorded:
Thus this run is not limited by the 16 GiB cache capacity or memory pressure. The fixed scan cutoff prevents further decoded-cache admission and leaves repeated decompression work on warm scans. These counters establish the active policy and reconstruction work; they are not a full per-key reuse-distance or unique-column census.
The separate normal profiles quantify where CPU goes:
CPU milliseconds sum work across query threads and must not be read as wall-clock latency. These are user-CPU samples, not a before/after improvement claim. Both listed categories resolve to foreground scan callchains in these recordings. Decode-leaf and owned-output-copy categories are disjoint; costs nested inside output copies are not counted again.
copyCachedVectoris used after both a cache hit and a fresh construction. Its inclusive cost cannot all be called hit-copy cost. The existing path binds the sealed representation only within the pinned scope and produces owned output. Removing that copy without a lifetime/mutability design would break the contract. The obvious identity-selection allocation inMaterializeCachedVectorWindowis in a bounded/window read path, rather than this ordinary scan loading path, so it is not the fix for these profiles.Recommended next production design: replace the fixed reader block-count admission cutoff with admission that uses the existing cache budget/pressure mechanisms while preserving scan-pollution protection. Demonstrate actual reused decoded entries and reduced reconstruction work; do not merely raise the configured capacity or remove output ownership. Keep lookup/admission/eviction and source lease ownership in their existing owners. Coordinate scan-admission/encoded-cache policy with #30848 rather than duplicate it.
Required controls include cold/one-pass and low-reuse scans, concurrent readers, limited capacity, rejection/eviction/pressure, early stop/cancellation and immutable-buffer release. Benchmark the whole application at the same budget and unchanged SQL, with separate score/profile runs, full Q1–Q22 screening and one confirmation of material signals. No cache production patch or PR was created in this diagnostic-only slice, and this broader issue remains open.
Local reproducible evidence:
build/exec-copy-scan-wave-20261028/exposure-profile-analysis.json,build/execution-kernels-wave/copy-scan-wave-exposure-v4-sf10, andbuild/execution-kernels-wave/copy-scan-wave-policy-sf10. The diagnostic source and binaries are separate from the normal baseline and rejected selected-copy prototype.aunjgr commentedon Oct 29, 2026
Reader admission fix: implementation and provisional SF10 comparison
The approved implementation removes the reader block-count cutoff and delegates ordinary admission/replacement to the existing S3-FIFO cache. Explicit caller cache policies, physical reservations, pressure handling, cache leases and owned output remain authoritative. The obsolete reader counter/threshold argument and helper are removed with all callers updated.
Local implementation commit:
7ac169f238a4f648b12b8ac2ec531b6ca87f146d(not pushed; no PR yet). Reader/package/constructor-consumer checks, the hot-working-set/scan and pressure controls, focused shared-cache race tests, and scoped default static analysis passed.Performance status: INCOMPLETE, five of six planned balanced process pairs retained. Repeated unrelated Cargo/Rust compilation and external CPU activity exhausted the last pair’s declared host retries. Failed attempts are retained and excluded in whole pairs; no unfavorable accepted timing was filtered. The final pair and separate target CPU profiles remain pending a quiet local window. These results do not complete the agreed acceptance or close the issue.
Frozen baseline main
b01e952ad1021ef8f188641f3a11a1360c001218; the measured candidate’s runtime source matches the local commit. Normal Go1.27.1 SIMD/v3 builds, eight dedicated physical CPUs, effective 16 GiB CN cache and 32 GiB whole-application budget. Each accepted arm executes unchanged Q1–Q22 with three warm measured calls/query after excluding the first cold call. Benchmark scripts execute and drain without input/schema/table/row/reference/result/checksum verification.The paired change is the median of within-pair ratios, not the ratio of marginal medians. No query has a slower interval in these five retained pairs; that is not proof of equivalence or final acceptance. All retained arms passed the recorded memory/host gates with zero physical reads/writes, spill, application swap or OOM. The candidate retained more decoded cache data within the same budget; profiles will distinguish avoided reconstruction from remaining output copies.
Evidence:
build/cache-scan-group-wave-20261029/cache-full-sf10. The completed five pairs will be retained; only the missing pair and profiles need completion. No SF100 or mixed-I/O acceptance is claimed.perf(fileservice): cache late scan reads without forced eviction (#32093
XuPeng-SH commentedon Nov 8, 2026
Merged-scope update for this issue #30849: related PR #32093 merged into main on 2026-11-08 at 20:42:19 UTC as 32dbfe1. It permits late scan reads to fill unused decoded-cache capacity without evicting resident data, with reservations charged through final release and transient fallback under capacity/pressure refusal. The later remote-cache allocator routing fix and integration with main's reference-owning S3-FIFO are recorded in #32093 (comment).
This is a bounded admission component of this explicitly broader reconstruction/copy-cost issue, not completion of all remaining optimization and scale acceptance. Keep the issue open with development; no QA reassignment or acceptance pass is claimed here.
Evidence limits: the author reports owning-package normal tests, focused/full affected race tests and pre-push static checks. The earlier SF1000 comparison reported +1.89% paired Total slowdown, and a later PR comment records acceptance of that tradeoff for review; neither that decision nor merging turns the original no-regression gate into a pass. The later source integration added no new TPC-H comparison, and the earlier SF100 signals were not freshly confirmed. Those older-source measurements are not asserted as verified counterexamples against this newly merged revision. I checked GitHub state and the issue/PR discussion only; no local product tests or benchmarks were run in this pass.
Remaining scope should be reconciled on the merged revision: attributable reconstruction versus owned-output copy cost, unchanged-query comparisons at applicable memory/mixed-I/O scales, and bounded residency/admission under selective, one-pass, pressure and retained-buffer controls. This update supersedes the issue's pre-replacement status only for the merged admission component.