Description
ApexStore stores full keys in every SSTable block. Competitive engines (RocksDB with prefix_extractor, LevelDB) use prefix compression within data blocks: consecutive keys sharing a common prefix store only the suffix, reducing I/O and storage.
Proposed Implementation
- During SSTable block building, detect shared prefixes between consecutive keys
- Store keys as
(shared_prefix_len, suffix) instead of full key bytes
- Add
prefix_extractor configuration option
- When enabled, bloom filters and index blocks can also use prefix-optimized lookups
Impact
- 30-50% SSTable size reduction for keys with common prefixes (e.g., time-series, user IDs)
- Faster scans (fewer bytes to read from disk)
- Better block cache utilization
Labels
Description
ApexStore stores full keys in every SSTable block. Competitive engines (RocksDB with prefix_extractor, LevelDB) use prefix compression within data blocks: consecutive keys sharing a common prefix store only the suffix, reducing I/O and storage.
Proposed Implementation
(shared_prefix_len, suffix)instead of full key bytesprefix_extractorconfiguration optionImpact
Labels