perf(delete): batch commit-time tombstone marker writes per storage page (C5) - #377
Merged
Merged
Conversation
…age (C5) ApplyBufferedTombstones -> TombstoneRecords still issued one 4-byte pwrite per deleted row even after #373 batched the per-marker length reads. The DELETE commit phase now patches every negative-prefix marker into the in-memory whole-file snapshot first (markers may straddle page boundaries because records are not page-aligned, so patching must happen on the contiguous buffer, not on per-page copies) and then flushes each touched storage page exactly once. A flushed page differs from the on-disk bytes only in its flipped marker words, so the full-page write is byte-for-byte equivalent to the individual marker writes it replaces. Runs under the same lock as before (appendLock on the commit path / table write lock on the durable path), so rollback semantics are unchanged. Fair-PK harness (--pk, same machine as master, 2 runs each): legacy DELETE ~70K -> ~81K ops/s (+16%) fixed-width DEL ~97K -> ~141K ops/s (+45%); DELETE gap vs SQLite -> ~2.4x Full suite: 1762 tests, 0 failed.
|
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.



Samenvatting
Commit-time tombstone-marker writes worden per storage-page gebundeld (C5).
ApplyBufferedTombstones→TombstoneRecordsdeed na #373 (whole-file range-read) nog steeds één 4-byte pwrite per verwijderde rij; dat domineerde de DELETE-commit-fase op dichte batches. Nu:ArgumentOutOfRangeExceptionop straddlers, gevonden doorFixedWidthBulkDeleteTests).Veiligheid: draait onder hetzelfde lock als voorheen (
appendLockop het commit-pad / table-write-lock op het duurzame pad); elke page maximaal één write vanuit de snapshot → rollback kan nooit een half toegepaste marker zien.Metingen (fair-PK harness
--pk, zelfde machine als master, 2 runs elk)DELETE-gap vs SQLite op fixed-width daalt daarmee van ~3,0-3,3x naar ~2,4x.
Validatie