fix(timeseries): make rekey_symbol linear on compressed chunks #90
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
gertjan/bodega!90
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/rekey-compressed-chunk-perf"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The re-key UPDATE's correlated NOT EXISTS cannot be pushed into
compressed chunks, so it decompressed per candidate row and went
quadratic: the 260-day backfill hung 18+ minutes on a single symbol
with 1.1k bars (planner cost ~2.9M).
Rewrite as copy-then-delete in one transaction:
to the new symbol (new-symbol rows still win on conflict, unchanged
semantics), then DELETE removes the old rows. moved/dropped counts are
derived from the two command tags.
(fetched first) purely for chunk pruning: compressed chunks keep their
full-size empty raw heaps and the planner seq-scans them on DML —
measured 44.9s per statement across the whole hypertable vs 2.4s
pruned on production.
the planner prefers seq scans over the bloated raw heaps; index scans
are ~5x faster (8.1s vs 44.9s unbounded).
without opening a write transaction.
Co-Authored-By: Claude Fable 5 noreply@anthropic.com