pub struct DiskAnnConfig {Show 14 fields
pub dimension: usize,
pub max_degree: usize,
pub build_beam_width: usize,
pub search_beam_width: usize,
pub alpha: f32,
pub pruning_strategy: PruningStrategy,
pub search_mode: SearchMode,
pub max_vectors_in_memory: Option<usize>,
pub use_pq_compression: bool,
pub pq_subvectors: Option<usize>,
pub pq_bits: Option<u8>,
pub enable_incremental_updates: bool,
pub num_entry_points: usize,
pub io_buffer_size: usize,
}Expand description
Configuration for DiskANN index
Fields§
§dimension: usizeVector dimensionality
max_degree: usizeMaximum degree of graph nodes (R parameter)
build_beam_width: usizeBeam width for graph construction (L parameter)
search_beam_width: usizeBeam width for search (L_search parameter)
alpha: f32Alpha parameter for pruning (typically 1.2)
pruning_strategy: PruningStrategyPruning strategy
search_mode: SearchModeSearch mode
max_vectors_in_memory: Option<usize>Maximum number of vectors to keep in memory
use_pq_compression: boolUse PQ compression for disk storage
pq_subvectors: Option<usize>Number of PQ sub-vectors (if compression enabled)
pq_bits: Option<u8>Number of bits per PQ code
enable_incremental_updates: boolEnable incremental updates
num_entry_points: usizeNumber of entry points for search
io_buffer_size: usizeBuffer size for disk I/O (bytes)
Implementations§
Source§impl DiskAnnConfig
impl DiskAnnConfig
Sourcepub fn default_config(dimension: usize) -> Self
pub fn default_config(dimension: usize) -> Self
Create default configuration
Sourcepub fn memory_optimized(dimension: usize) -> Self
pub fn memory_optimized(dimension: usize) -> Self
Create configuration optimized for memory
Sourcepub fn speed_optimized(dimension: usize) -> Self
pub fn speed_optimized(dimension: usize) -> Self
Create configuration optimized for speed
Sourcepub fn billion_scale(dimension: usize) -> Self
pub fn billion_scale(dimension: usize) -> Self
Create configuration for billion-scale datasets
Sourcepub fn estimate_memory_usage(&self, num_vectors: usize) -> usize
pub fn estimate_memory_usage(&self, num_vectors: usize) -> usize
Get memory estimate for index (in bytes)
Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for DiskAnnConfig
impl<'__de, __Context> BorrowDecode<'__de, __Context> for DiskAnnConfig
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Source§impl Clone for DiskAnnConfig
impl Clone for DiskAnnConfig
Source§fn clone(&self) -> DiskAnnConfig
fn clone(&self) -> DiskAnnConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DiskAnnConfig
impl Debug for DiskAnnConfig
Source§impl<__Context> Decode<__Context> for DiskAnnConfig
impl<__Context> Decode<__Context> for DiskAnnConfig
Source§impl Default for DiskAnnConfig
impl Default for DiskAnnConfig
Source§impl<'de> Deserialize<'de> for DiskAnnConfig
impl<'de> Deserialize<'de> for DiskAnnConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Encode for DiskAnnConfig
impl Encode for DiskAnnConfig
Auto Trait Implementations§
impl Freeze for DiskAnnConfig
impl RefUnwindSafe for DiskAnnConfig
impl Send for DiskAnnConfig
impl Sync for DiskAnnConfig
impl Unpin for DiskAnnConfig
impl UnwindSafe for DiskAnnConfig
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
Mutably borrows from an owned value. Read more
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.