SELECT · MERGE · VERIFY
Compaction strategies
Inspect which SSTables are read, which record versions survive, and how output ranges change.
Current files
Exact records and read comparison
Inspect input versions and output records
Compaction must preserve logical reads
The starting fixture contains three older base files and five newer flushes. Each record has an integer key, a value and a mutation timestamp. Compaction reads selected files, keeps the newest selected version of each key and writes new sorted files. Older versions outside the selected files remain on disk; the final read still reconciles all candidate versions. The read probe shows the winning value before and after compaction. A correct merge can reduce duplicate versions without changing that answer. Expand the record inspector to examine the exact input and output rows rather than relying on file counts alone.
Choose and inspect a policy
Strategy selects one of three bounded teaching policies. Size-tiered groups files by row count, allowing up to a 1.5 size ratio against the smallest file in a bucket, and chooses the smallest qualifying bucket. Input threshold controls the number selected. Leveled selects an oldest threshold-sized group of L0 files plus every L1 file overlapping their combined key span. Maximum output rows splits the merged result into non-overlapping L1 runs and is enabled only for this policy. Time-window assigns each file by its maximum timestamp divided by Window width. It selects one qualifying window: closed windows need two files, while the active window uses Input threshold. Window width is enabled only for time-window mode.
Try concrete comparisons
With size-tiered defaults, four four-row flushes are selected: sixteen input rows become fourteen output rows because two keys have newer versions. Switch to leveled and inspect the extra overlapping L1 inputs, then reduce maximum output rows from eight to four. Output file count changes, but the logical value for every key must remain unchanged. Set Input threshold to six: only five L0 flushes exist, so the leveled operation does nothing. In time-window mode, enable Mix an old timestamp into the newest flush. The old record shares a file with recent data and follows that file's maximum timestamp; a window label does not prove every contained row is equally old.
Use the inspection tools honestly
Read-probe key selects any key from zero through twenty-three and shows candidate files by key-range intersection, not measured disk reads. Restore defaults resets inputs. Play reveals selection, merge and output across sixty inspection seconds; Pause holds the current layout, Next stage advances a phase, Restart rewinds, Speed changes teaching pace, and Inspection seconds scrubs. Changing a policy rebuilds the same deterministic starting data. Row counts stand in for size; there are no actual SSTables, Bloom filters, compression, tombstones, TTL expiration, disk-space limits or concurrent writes. This illustrates three selection trade-offs, not exact production scheduling, the full LCS level hierarchy or modern Unified Compaction Strategy. No percentage here is a performance prediction.
Reference: size-tiered compaction and time-window compaction. This offline fixture never accesses a database.