Skip to content

perf: batch contiguous-UPDATE hash re-points + scan/COUNT delete regression tests - #364

Merged
MPCoreDeveloper merged 2 commits into
masterfrom
perf/batch-index-repoint-count-tests
Sep 3, 2026
Merged

perf: batch contiguous-UPDATE hash re-points + scan/COUNT delete regression tests#364
MPCoreDeveloper merged 2 commits into
masterfrom
perf/batch-index-repoint-count-tests

Conversation

@MPCoreDeveloper

Copy link
Copy Markdown
Owner

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-row hashIndex.Remove + Add for 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 with HashIndex.RemoveBatchKeys + a new key-based AddBatchKeys — 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) and COUNT(*) matches.
  • GappedDeletes_FallBackToGenericLoop_AndStayCorrect now also asserts the live scan is exactly the 400 even rows.

Tests

Full suite 1655/1655.

Note: a fresh --pk measurement 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.

MPCoreDeveloper 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.
@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

@MPCoreDeveloper
MPCoreDeveloper merged commit f918019 into master Sep 3, 2026
13 checks passed
@MPCoreDeveloper
MPCoreDeveloper deleted the perf/batch-index-repoint-count-tests branch September 3, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant