pub struct IndexInfo { /* private fields */ }Expand description
Information about a query plan.
This struct contains all of the information about a query plan that SQLite is attempting on the virtual table. The struct will be passed to VTab::best_index.
This struct is both an input and an output. The virtual table implementation should examine the constraints and order_by fields, decide on the best query plan, and then set the results using IndexInfoConstraint::set_argv_index, set_estimated_cost, and the other methods.
Implementations§
Source§impl IndexInfo
impl IndexInfo
pub fn constraints(&self) -> IndexInfoConstraintIterator<'_> ⓘ
pub fn order_by(&self) -> IndexInfoOrderByIterator<'_> ⓘ
Sourcepub fn distinct_mode(&self) -> DistinctMode
pub fn distinct_mode(&self) -> DistinctMode
Determine if a query is DISTINCT.
Requires SQLite 3.38.0. On earlier versions, this function will always return DistinctMode::Ordered.
Sourcepub fn index_num(&self) -> i32
pub fn index_num(&self) -> i32
Retrieve the value previously set by set_index_num.
Sourcepub fn set_index_num(&mut self, val: i32)
pub fn set_index_num(&mut self, val: i32)
Set the index number of this query plan. This is an arbitrary value which will be passed to VTabCursor::filter.
Sourcepub fn index_str(&self) -> Option<&str>
pub fn index_str(&self) -> Option<&str>
Retrieve the value previously set by set_index_str.
Sourcepub fn set_index_str(&mut self, val: Option<&str>) -> Result<()>
pub fn set_index_str(&mut self, val: Option<&str>) -> Result<()>
Set the index string of this query plan. This is an arbitrary value which will be passed to VTabCursor::filter.
This function can fail if SQLite is not able to allocate memory for the string.
Sourcepub fn set_index_str_static(&mut self, val: &'static CStr)
pub fn set_index_str_static(&mut self, val: &'static CStr)
Set the index string without copying.
Sourcepub fn order_by_consumed(&self) -> bool
pub fn order_by_consumed(&self) -> bool
Retrieve the value previously set by set_order_by_consumed.
Sourcepub fn set_order_by_consumed(&mut self, val: bool)
pub fn set_order_by_consumed(&mut self, val: bool)
Indicate that the virtual table fully understands the requirements of the order_by and distinct_mode fields. If this is the case, then SQLite can omit reordering the results of the query, which may improve performance. It is never necessary to use the order_by information, but virtual tables may opt to use it as a performance optimization.
Sourcepub fn estimated_cost(&self) -> f64
pub fn estimated_cost(&self) -> f64
Retrieve the value previously set by set_estimated_cost.
pub fn set_estimated_cost(&mut self, val: f64)
Sourcepub fn estimated_rows(&self) -> Result<i64>
pub fn estimated_rows(&self) -> Result<i64>
Retrieve the value previously set by set_estimated_rows.
Requires SQLite 3.8.2.
Sourcepub fn set_estimated_rows(&mut self, val: i64)
pub fn set_estimated_rows(&mut self, val: i64)
Requires SQLite 3.8.2. On earlier versions of SQLite, this function is a harmless no-op.
Sourcepub fn scan_flags(&self) -> Result<usize>
pub fn scan_flags(&self) -> Result<usize>
Retrieve the value previously set by set_scan_flags.
Requires SQLite 3.9.0.
Sourcepub fn set_scan_flags(&mut self, val: usize)
pub fn set_scan_flags(&mut self, val: usize)
Requires SQLite 3.9.0. On earlier versions of SQLite, this function is a harmless no-op.
Sourcepub fn columns_used(&self) -> Result<u64>
pub fn columns_used(&self) -> Result<u64>
Requires SQLite 3.10.0.