perf: run the contiguous UPDATE/DELETE fast paths on plaintext default-config tables - #363
Merged
Merged
Conversation
…t-config tables The bulk fast paths previously required DatabaseConfig.NoEncryptMode, although per-record encryption is opt-in (EnableAtRestRecordEncryption): default-config databases already store plaintext records. Gate on the storage layer's runtime AreRecordsEncrypted (UseRecordEncryption && file carries the encrypted magic header) instead of the config flag, so default-config users get the single-pass UPDATE/DELETE path too; genuinely encrypted tables still fall back to the generic loop.
|
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
The contiguous single-pass UPDATE (#360) and DELETE (#361) fast paths previously required
DatabaseConfig.NoEncryptMode, even though per-record encryption is opt-in (EnableAtRestRecordEncryption) — default-config databases already store plaintext records, so default users were silently missing the fast path.The gate now checks the storage layer's runtime
AreRecordsEncrypted(UseRecordEncryption &&the file carries the encrypted-table magic header) instead of the config flag. Default-config (plaintext) tables get the single-pass path; genuinely per-record-encrypted tables still fall back to the generic loop.Tests
DefaultPlaintextConfig_EngagesBulkPath_AndStaysCorrect— default config (noNoEncryptMode) now engages the fast path and stays correct.PerRecordEncryption_FallsBackToGenericLoop_AndStaysCorrect—EnableAtRestRecordEncryption = true(ciphertext records with magic header) still falls back and stays correct.