Add SSTable#8
Merged
Merged
Conversation
adambcomer
force-pushed
the
adambcomer/11232025-add-sstable
branch
4 times, most recently
from
November 28, 2025 06:21
d5c2228 to
8da4d35
Compare
adambcomer
force-pushed
the
adambcomer/11232025-add-sstable
branch
from
December 6, 2025 10:18
8da4d35 to
e14a908
Compare
adambcomer
force-pushed
the
adambcomer/11232025-add-sstable
branch
from
April 19, 2026 04:00
e14a908 to
2bc25c9
Compare
adambcomer
marked this pull request as ready for review
April 19, 2026 04:02
adambcomer
force-pushed
the
adambcomer/11232025-add-sstable
branch
from
April 19, 2026 07:03
2bc25c9 to
7b41be1
Compare
adambcomer
force-pushed
the
adambcomer/11232025-add-sstable
branch
from
April 19, 2026 07:09
7b41be1 to
bb1b0f0
Compare
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.
This PR introduces the SSTable, the on-disk sorted string table used to persist flushed MemTable data
SSTable::new— flushes a MemTable to a level-partitioned .sstable file, recording per-entry byte offsets for O(log n) binary searchSSTable::load_from_path— reconstructs an SSTable (offsets, low/high keys) by scanning an existing file on diskSSTable::key_in_range— cheaply checks whether a key falls within the table's min/max bounds before doing a full lookupSSTable::get— binary searches the offset index to locate an entry without scanning the entire file; supports tombstone entries (deleted keys)Tests cover: file format correctness, loading from disk, range checks (including boundaries), get for present/deleted/missing keys, single-entry edge cases, and binary search against first/last entries.
Blog article: https://adambcomer.com/blog/simple-database/sstable/