pub struct OptimizersConfigDiff {
pub deleted_threshold: Option<f64>,
pub vacuum_min_vector_number: Option<u64>,
pub default_segment_number: Option<u64>,
pub max_segment_size: Option<u64>,
pub memmap_threshold: Option<u64>,
pub indexing_threshold: Option<u64>,
pub flush_interval_sec: Option<u64>,
pub max_optimization_threads: Option<u64>,
}
Fields§
§deleted_threshold: Option<f64>
The minimal fraction of deleted vectors in a segment, required to perform segment optimization
vacuum_min_vector_number: Option<u64>
The minimal number of vectors in a segment, required to perform segment optimization
default_segment_number: Option<u64>
Target amount of segments the optimizer will try to keep. Real amount of segments may vary depending on multiple parameters:
- Amount of stored points.
- Current write RPS.
It is recommended to select the default number of segments as a factor of the number of search threads, so that each segment would be handled evenly by one of the threads.
max_segment_size: Option<u64>
Do not create segments larger this size (in kilobytes). Large segments might require disproportionately long indexation times, therefore it makes sense to limit the size of segments.
If indexing speed is more important - make this parameter lower. If search speed is more important - make this parameter higher. Note: 1Kb = 1 vector of size 256 If not set, will be automatically selected considering the number of available CPUs.
memmap_threshold: Option<u64>
Maximum size (in kilobytes) of vectors to store in-memory per segment. Segments larger than this threshold will be stored as read-only memmaped file.
Memmap storage is disabled by default, to enable it, set this threshold to a reasonable value.
To disable memmap storage, set this to 0
.
Note: 1Kb = 1 vector of size 256
indexing_threshold: Option<u64>
Maximum size (in kilobytes) of vectors allowed for plain index, exceeding this threshold will enable vector indexing
Default value is 20,000, based on <https://github.com/google-research/google-research/blob/master/scann/docs/algorithms.md.>
To disable vector indexing, set to 0
.
Note: 1kB = 1 vector of size 256.
flush_interval_sec: Option<u64>
Interval between forced flushes.
max_optimization_threads: Option<u64>
Max number of threads (jobs) for running optimizations per shard.
Note: each optimization job will also use max_indexing_threads
threads by itself for index building.
If null - have no limit and choose dynamically to saturate CPU.
If 0 - no optimization threads, optimizations will be disabled.
Implementations§
source§impl OptimizersConfigDiff
impl OptimizersConfigDiff
sourcepub fn deleted_threshold(&self) -> f64
pub fn deleted_threshold(&self) -> f64
Returns the value of deleted_threshold
, or the default value if deleted_threshold
is unset.
sourcepub fn vacuum_min_vector_number(&self) -> u64
pub fn vacuum_min_vector_number(&self) -> u64
Returns the value of vacuum_min_vector_number
, or the default value if vacuum_min_vector_number
is unset.
sourcepub fn default_segment_number(&self) -> u64
pub fn default_segment_number(&self) -> u64
Returns the value of default_segment_number
, or the default value if default_segment_number
is unset.
sourcepub fn max_segment_size(&self) -> u64
pub fn max_segment_size(&self) -> u64
Returns the value of max_segment_size
, or the default value if max_segment_size
is unset.
sourcepub fn memmap_threshold(&self) -> u64
pub fn memmap_threshold(&self) -> u64
Returns the value of memmap_threshold
, or the default value if memmap_threshold
is unset.
sourcepub fn indexing_threshold(&self) -> u64
pub fn indexing_threshold(&self) -> u64
Returns the value of indexing_threshold
, or the default value if indexing_threshold
is unset.
sourcepub fn flush_interval_sec(&self) -> u64
pub fn flush_interval_sec(&self) -> u64
Returns the value of flush_interval_sec
, or the default value if flush_interval_sec
is unset.
sourcepub fn max_optimization_threads(&self) -> u64
pub fn max_optimization_threads(&self) -> u64
Returns the value of max_optimization_threads
, or the default value if max_optimization_threads
is unset.
Trait Implementations§
source§impl Clone for OptimizersConfigDiff
impl Clone for OptimizersConfigDiff
source§fn clone(&self) -> OptimizersConfigDiff
fn clone(&self) -> OptimizersConfigDiff
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for OptimizersConfigDiff
impl Debug for OptimizersConfigDiff
source§impl Default for OptimizersConfigDiff
impl Default for OptimizersConfigDiff
source§impl From<OptimizersConfigDiffBuilder> for OptimizersConfigDiff
impl From<OptimizersConfigDiffBuilder> for OptimizersConfigDiff
source§fn from(value: OptimizersConfigDiffBuilder) -> Self
fn from(value: OptimizersConfigDiffBuilder) -> Self
source§impl Message for OptimizersConfigDiff
impl Message for OptimizersConfigDiff
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for OptimizersConfigDiff
impl PartialEq for OptimizersConfigDiff
impl Copy for OptimizersConfigDiff
impl StructuralPartialEq for OptimizersConfigDiff
Auto Trait Implementations§
impl Freeze for OptimizersConfigDiff
impl RefUnwindSafe for OptimizersConfigDiff
impl Send for OptimizersConfigDiff
impl Sync for OptimizersConfigDiff
impl Unpin for OptimizersConfigDiff
impl UnwindSafe for OptimizersConfigDiff
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request