Interpolation search for SST index blocks
RocksDB adds interpolation search for SST index blocks, which estimates the probe position from key values and needs an expected O(log log n) probes on uniformly distributed keys, versus Θ(log n) for binary search. Keys are mapped to uint64 by reading the first 8 big-endian bytes after the boundary keys' common prefix, zero-padded so bytewise order is preserved. That is why the feature requires BytewiseComparator, and it falls back to binary search when keys collide. The recommended kAuto mode sets a per-block is_uniform footer bit at write time when the coefficient of variation of restart-key gaps, computed with Welford's algorithm, falls below uniform_cv_threshold. This costs about 0.08% of write CPU and gave a 9.2% point-read throughput gain, but SSTs with the bit set read as corruption on RocksDB versions before 11.0.0.
Related posts
- FIFO KV-Ratio Compaction for BlobDB-Backed TTL Workloads
RocksDB Blog hardMasterRocksDB 11.0 adds a KV-ratio intra-L0 compaction picker for FIFO compaction with integrated BlobDB. It targets workloads with large values, point lookups and TTL or size-bounded expiry. The old cost-based picker compares SST sizes against write_buffer_size, so BlobDB's tiny SSTs never stop growing. The new picker derives a target SST size from max_data_files_size × (SST bytes / total bytes) ÷ level0_file_num_compaction_trigger, then merges files through geometric size tiers until they graduate. This keeps blob files untouched and SST rewrite cost logarithmic, at the cost of some intermediate tier files lingering in L0.
- Range Tombstone Conversion: Faster Scans Over Long Runs of Deletes
RocksDB Blog hardMasterRocksDB 11.3.0 adds range tombstone conversion: when a read iterator walks a run of contiguous point tombstones with no live key between them, it inserts one redundant range tombstone [first_tombstone_key, next_live_key) into the memtable at the iterator's snapshot sequence number. Later scans then skip the run in one hop instead of O(N) steps. Only the iterator can do this safely, because it merges every memtable and SST level, while flush and compaction see only part of the LSM and could shadow live keys at other levels. The feature is off by default and enabled with the dynamic option min_tombstones_for_range_conversion. db_bench shows ~99x faster forward and ~368x faster reverse scans over delete-heavy data, with no regression when there are no tombstones.
- Native Async/Coroutine Reads in RocksDB
RocksDB Blog hardMasterRocksDB 11.10.0 adds experimental native asynchronous Get/MultiGet APIs (callback-based GetAsync/MultiGetAsync and Folly-task-based CoroDB::CoGet/CoMultiGet) that suspend a read at the SST block-miss filesystem boundary and resume it on the same io_uring-backed EventBase thread, so a small read executor can sustain high storage queue depth without one parked thread per read. Per-request PerfContext/IOStatsContext are swapped in and out of TLS via Folly RequestContext, with CPU time counted only during active slices. Benchmarks on four cores with an 11 GB direct-I/O dataset show coroutines losing ~14% at low concurrency with single-key lookups but gaining up to 305% over threads with larger batches, and 8–55% over the older ReadOptions::async_io path at 20+ tasks.
- ClickHouse Release 24.11
ClickHouse mediumAdept
ClickHouse 24.11 makes parallel hash join the default join algorithm, building several hash tables concurrently for speed at the cost of more memory, and adds zero-copy block scattering between threads. ORDER BY WITH FILL gains a STALENESS modifier that stops generating filler rows once the gap from the previous real row exceeds a threshold. The HTTP interface now surfaces errors that happen mid-stream as a non-zero client exit code, and a new mark_cache_prewarm_ratio setting plus a SYSTEM PREWARM MARK CACHE command let the server load index marks into memory eagerly. An experimental BFloat16 type speeds up vector search: a full-scan nearest-neighbor query over 28M 384-dimensional vectors took 0.061s versus 0.146s with Float32.
- A journey to io_uring, AIO and modern storage devices
ClickHouse mediumAdept
Single random read latency was benchmarked with pread(2) across HDD, SATA SSD, NVMe SSD and Intel Optane, at block sizes from 4 KB to 32 MB. On HDD, seek time dominates below 256 KB, averaging about 12 ms. SATA SSD reads 4 KB in about 140 µs. NVMe mainly improves tail latency over SATA SSD. Optane reaches 12 µs minimum latency but has high tail variance, which polling mode (preadv2 with RWF_HIPRI) halves for blocks up to 256 KB. The recommended random-read block sizes are 256 KB for HDD, 4 KB for SATA and NVMe SSDs, and 8 KB for Optane.