Reference2 min readgenerated from the code
Query modes
What a table can be asked, and what each mode costs to ask. A mode a table cannot answer is reported with a reason rather than returning nothing — a search that silently finds nothing looks exactly like a search that found nothing.
| mode | needs | notes |
|---|---|---|
scan |
nothing | a filter and a page of rows |
fts |
an inverted index on a string column | uses the index; returns _score |
vector |
a vector column | uses an ANN index if one exists and the metric matches; otherwise scans every row. Returns _distance |
hybrid |
both of the above | two searches fused by rank, each leg costed separately |
Access paths
Lance's plan says which path a query took, before it runs. These are the ones the console names:
| operator | called | meaning |
|---|---|---|
KNNVectorDistance |
brute-force vector scan | Every row's vector is read and compared. Exact, and linear in table size. |
ANNSubIndex |
ANN index | An approximate index narrowed the candidates before distances were computed. |
ANNIvfPartition |
ANN index | An approximate index narrowed the candidates before distances were computed. |
MatchQuery |
inverted index | Full-text search used the inverted index rather than reading the column. |
ScalarIndexQuery |
scalar index | A scalar index answered part of the filter without reading the column. |
MaterializeIndex |
scalar index | A scalar index answered part of the filter without reading the column. |
Limits
- a page returns at most 200 rows
- a search returns at most k = 200
- a request waits 30s by default, then stops waiting — Lance offers no way to interrupt a running scan, so the scan continues until it finishes
Heavy columns
Vectors, binary columns and Blob V2 columns are never read into a result. They are described from the schema, and no parameter of any query route can expand one.