pub struct BoundIndexExprs {
pub position: usize,
pub predicate: Option<BoundExpr>,
pub keys: Vec<Option<BoundExpr>>,
}Expand description
The expressions one index needs evaluated per row to be maintained.
An index is usually just columns of the row, and then it needs none of
this. A partial index holds only the rows its predicate accepts, and an
index on an expression holds a value no column carries - so for those two,
maintaining the index means evaluating something per row rather than
copying a slot. They travel on the bound statement for the same reason the
table’s CHECK predicates do: the binder is what can turn schema text into
a BoundExpr, and the write path is what runs it.
The list holds only the indexes that need it, so a table with neither kind leaves it empty and the write path’s loop runs zero times - which is every table the gate measures.
Fields§
§position: usizeThe index’s position in the table’s indexes.
predicate: Option<BoundExpr>The partial-index predicate, when it has one.
keys: Vec<Option<BoundExpr>>One per key column: the expression it indexes, or None for a column.