-
Notifications
You must be signed in to change notification settings - Fork 466
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sstable: add block level suffix replacement support
This patch teaches the block iterator to replace the suffix of all surfaced keys with a replacement suffix passed during block initiation. In other words, the iterator will read the block as if all underlying keys actually had the replacement prefix. For correctness, this patch relies on two invariants: for all keys in the block: 1. no two keys in the sst share the same prefix 2. byte.Compare(replacementSuffix,originalSuffix) > 0 During the normal readpath, i.e. for blocks without suffix rewriting, this patch does slow Seeks down: ``` ❯ benchstat master suffix name old time/op new time/op delta BlockIterSeekGE/restart=16-24 345ns ± 0% 367ns ± 0% +6.53% (p=0.002 n=6+6) BlockIterSeekLT/restart=16-24 398ns ± 0% 416ns ± 0% +4.55% (p=0.008 n=5+5) BlockIterNext/restart=16-24 15.4ns ± 0% 15.6ns ± 0% +1.09% (p=0.002 n=6+6) BlockIterPrev/restart=16-24 30.6ns ± 0% 30.6ns ± 0% -0.23% (p=0.006 n=6+6) ```
- Loading branch information
Showing
9 changed files
with
470 additions
and
40 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.