pub struct IndexInfo {
pub constraints: Vec<IndexConstraint>,
pub order_by: Vec<IndexOrderBy>,
pub constraint_usage: Vec<IndexConstraintUsage>,
pub idx_num: i32,
pub idx_str: Option<String>,
pub order_by_consumed: bool,
pub estimated_cost: f64,
pub estimated_rows: i64,
}Expand description
Information exchanged between the query planner and virtual table during index selection.
The planner fills constraints and order_by. The vtab fills
constraint_usage, idx_num, idx_str, order_by_consumed,
estimated_cost, and estimated_rows.
Fields§
§constraints: Vec<IndexConstraint>WHERE clause constraints the planner is considering. This is read-only input: implementations must not mutate, reorder, or resize it.
order_by: Vec<IndexOrderBy>ORDER BY terms from the query. This is read-only input and must not be mutated, reordered, or resized.
constraint_usage: Vec<IndexConstraintUsage>How each constraint maps to filter arguments (vtab fills this). The
vector length is fixed by the core and must remain equal to
constraints.len().
idx_num: i32Integer identifier for the chosen index strategy.
idx_str: Option<String>Optional string identifier for the chosen index strategy.
order_by_consumed: boolWhether the vtab guarantees the output is already sorted.
estimated_cost: f64Estimated cost of the scan (lower is better).
estimated_rows: i64Estimated number of rows returned.
Implementations§
Source§impl IndexInfo
impl IndexInfo
Sourcepub fn new(
constraints: Vec<IndexConstraint>,
order_by: Vec<IndexOrderBy>,
) -> Self
pub fn new( constraints: Vec<IndexConstraint>, order_by: Vec<IndexOrderBy>, ) -> Self
Create a new IndexInfo with the given constraints and order-by terms.