pub struct IvfflatParams {
pub lists: usize,
pub probes: usize,
}Expand description
IVFFlat 索引参数
lists 参数控制聚类中心数量,通常建议:
- 数据量 < 100 万:
lists = sqrt(rows) - 数据量 >= 100 万:
lists = rows / 1000
Fields§
§lists: usize聚类中心数量(lists)
probes: usize查询时探测的聚类数量(probes)
Implementations§
Source§impl IvfflatParams
impl IvfflatParams
Sourcepub fn recommended_for_rows(rows: usize) -> Self
pub fn recommended_for_rows(rows: usize) -> Self
根据数据量自动推荐 lists 参数
Sourcepub fn to_sql_options(&self) -> String
pub fn to_sql_options(&self) -> String
生成 SQL 选项子句(WITH (lists = N))
Trait Implementations§
Source§impl Clone for IvfflatParams
impl Clone for IvfflatParams
Source§fn clone(&self) -> IvfflatParams
fn clone(&self) -> IvfflatParams
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 IvfflatParams
impl Debug for IvfflatParams
Auto Trait Implementations§
impl Freeze for IvfflatParams
impl RefUnwindSafe for IvfflatParams
impl Send for IvfflatParams
impl Sync for IvfflatParams
impl Unpin for IvfflatParams
impl UnsafeUnpin for IvfflatParams
impl UnwindSafe for IvfflatParams
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