pub enum IndexBlockSearchType {
Binary = 0,
Interpolation = 1,
Auto = 2,
}Expand description
Index-block search algorithm selected by
BlockBasedOptions::set_index_block_search_type.
Auto is only meaningful in combination with
BlockBasedOptions::set_uniform_cv_threshold: the threshold gates whether
the per-block “is_uniform” footer bit is set on the write path, and Auto
reads that bit at lookup time to choose between binary and interpolation
search per index block. Without setting the threshold to a non-negative
value, Auto degenerates to binary search.
Variants§
Binary = 0
Standard binary search. The default and safest choice.
Interpolation = 1
Interpolation search. Faster than binary search for index blocks whose keys are uniformly distributed; significantly slower when they are not.
Only applicable when the byte-wise comparator is in use; with any other comparator the C++ code falls back to binary search regardless.
Performance is significantly degraded when
IndexShorteningMode::kShortenSeparatorsAndSuccessor is also set,
because the shortened successor skews end-keys away from the uniform
distribution that interpolation search relies on. Avoid combining the
two.
Auto = 2
Per-block adaptive selection between binary and interpolation search,
based on the per-block “is_uniform” footer bit. Requires
uniform_cv_threshold >= 0 on the write path; see
BlockBasedOptions::set_uniform_cv_threshold.
Trait Implementations§
Source§impl Clone for IndexBlockSearchType
impl Clone for IndexBlockSearchType
Source§fn clone(&self) -> IndexBlockSearchType
fn clone(&self) -> IndexBlockSearchType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IndexBlockSearchType
impl Debug for IndexBlockSearchType
Source§impl PartialEq for IndexBlockSearchType
impl PartialEq for IndexBlockSearchType
Source§fn eq(&self, other: &IndexBlockSearchType) -> bool
fn eq(&self, other: &IndexBlockSearchType) -> bool
self and other values to be equal, and is used by ==.