HashSearch Optimization
Application scenario: When RocksDB looks up records in SST files, HashSearch is used to locate the candidate data block range.
Technical principle: In RocksDB, HashSearch is used to quickly locate the candidate index block entries and data blocks that may contain the target record based on the key prefix, reducing invalid index block comparisons and unnecessary drive I/O. Because query operations frequently pass through this path, the accuracy of candidate range locating, the reliability of metadata parsing, and the underlying parsing efficiency are particularly critical. While ensuring query correctness and SST file format compatibility, this feature provides targeted optimizations to the HashSearch read path. For scenarios involving prefix configuration changes, HashSearch metadata loading, and block parsing overhead, the optimization maintains stable prefix rules across different SST files and determines at query time whether the current configuration can safely use HashSearch. When the configuration matches, it narrows the candidate data block range; when it does not, it automatically falls back to regular binary search, avoiding missed lookups caused by incorrectly narrowing the range.
Performance metric: The performance on YCSB workloads A to F is improved by 7% on average.
