perf(delete): bulk descending PK-delete on the generic DELETE path - #376
Merged
Conversation
…5-bulk) IIndex gains DeleteBulk (default = per-key Delete). BTree.DeleteBulk sorts the batch in descending key order so consecutive removals run along the rightmost leaf path, triggering far fewer internal-separator promotions than deleting in arbitrary per-row resolution order. DeleteRecordsCore collects the batch's PK keys once and removes them via DeleteBulk instead of per-key Delete. Correctness is unchanged (same key set, one visit per key; PK unique). Fair-PK harness (--pk, AppendOnly legacy): DELETE ~69-72K ops/s on strictly ascending batches (within noise); the win concentrates on unordered key sets. Regression: LegacyLayoutBatchDelete_BulkPkRemove_StaysCorrectAcrossReopen drives the generic bulk path on a legacy-layout table (fixed-width disabled) and reopens to prove tombstones + on-load PK-index rebuild do not resurrect rows. 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
Bulk aflopende PK-delete op het generieke DELETE-pad (
DeleteRecordsCore).IIndexkrijgt eenDeleteBulk(IEnumerable<TKey>)(default = per-keyDelete).BTree.DeleteBulksorteert de batch aflopend zodat opeenvolgende removals langs het rechter-bladpad lopen -> veel minder interne separator-promoties/rebalances dan willekeurige per-rij resolutievolgorde.DeleteRecordsCoreverzamelt de PK-sleutels van de batch eenmalig en verwijdert ze viaDeleteBulki.p.v. per-keyDelete.Correctheid
LegacyLayoutBatchDelete_BulkPkRemove_StaysCorrectAcrossReopen: forceert het generieke pad (fixed-width uit), verwijdert 1..1000 van 2000, controleert PK- en hash-lookups en reopen (tombstones + PK-index-rebuild mogen rijen niet herrijzen).Metingen (fair-PK harness
--pk, AppendOnly, zelfde machine als master)Op strikt oplopende batch-deletes is het effect binnen de meetruis (die volgorde was al vrijwel boomvriendelijk). De winst zit bij ongeordende keysets (hash-geselecteerde subselects, reverse/random batches) die voorheen per sprong een separator-promotie betaalden. Deze stap is daarmee de correctheids-neutrale ordering-fix + infrastructuur op het generieke pad; de structurele DELETE-winst komt uit de fixed-width/PageBased-track (Fase B), zoals vastgelegd in het uitvoerplan.