perf: batch contiguous-UPDATE hash re-points + scan/COUNT delete regression tests - #364
Merged
Merged
Conversation
added 2 commits
September 3, 2026 15:29
…; lock scan/count-after-DELETE regression UpdateMultiple's contiguous fast path previously did a per-row hashIndex.Remove + Add for each fixed-size indexed SET column (2 lock acquisitions per row per index). It now collects old/new keys for every touched index and applies them with HashIndex.RemoveBatchKeys + new AddBatchKeys (one lock per index per batch). Adds count/scan regression tests for delete paths: BulkDelete_ScanAndCountStayConsistent (contiguous bulk delete: SELECT returns exactly the 1000 live rows > id 1000 and COUNT(*) matches) and GappedDeletes now also asserts the live scan is exactly the 400 even rows — locking in the resolution of the earlier COUNT-after-DELETE inconsistency (root cause was the BTree.Delete separator corruption fixed in #361).
…GELOG + docs/benchmarks Unreleased performance entries for AutoFixedWidthRecords, single-pass contiguous UPDATE/DELETE (B8/B9), the BTree separator-delete fix and the batched hash re-points, plus a fair-PK benchmark sheet with the machine-noise caveat.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Two related improvements on the contiguous UPDATE/DELETE fast paths:
1. Batched hash re-points (perf).
UpdateMultiple's contiguous fast path did a per-rowhashIndex.Remove+Addfor each fixed-size indexed SET column (2 lock acquisitions per row per index). It now collects old/new keys per touched index and applies them withHashIndex.RemoveBatchKeys+ a new key-basedAddBatchKeys— one lock acquisition per index per batch.2. Scan/COUNT regression coverage (correctness). The earlier COUNT-after-DELETE inconsistency is confirmed resolved (root cause: the BTree.Delete separator corruption fixed in #361). Locks it in:
BulkDelete_ScanAndCountStayConsistent— contiguous bulk delete: full scan returns exactly the 1000 live rows (all > id 1000) andCOUNT(*)matches.GappedDeletes_FallBackToGenericLoop_AndStayCorrectnow also asserts the live scan is exactly the 400 even rows.Tests
Full suite 1655/1655.
Note: a fresh
--pkmeasurement on this machine was too noisy (SQLite itself dropped to ~103K UPDATE from the usual ~230-270K, i.e. machine load), so no honest absolute delta could be reported for the batched re-points.