You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
143628: sql: add support for prefix columns to vector search r=michae2,andy-kimball a=DrewKimball
#### opt: use lookup-join instead of index-join for vector search
Index joins expect all input rows to find a match in the primary index,
excluding locked rows when in skip locked mode. Vector indexes can have
"dangling" vectors after a delete operation fails to locate a vector in
the index. Accordingly, this commit changes the vector-search optimizer
rule to use a lookup-join instead of an index-join to avoid violating
assumptions made elsewhere in the optimizer.
Epic: CRDB-42943
Release note: None
#### opt: do not plan vector search for a locking scan
This commit disallows vector-search when the original scan is performing
locking. Even if we did support this, it is unclear which rows should be
locked, so it seems best to disallow it entirely.
Epic: CRDB-42943
Release note: None
#### sql: add execution support for vector search with multiple prefix keys
This commit changes the vector-search operator to propagate a constraint
set rather than a single list of values to be used in constraining index
prefix columns. Execution has been modified as well to handle multiple
prefixes. This change will allow the vector-search optimizer rule to
handle cases where prefix columns can take on multiple possible values.
Note that modifying the vector search rule to take advantage of this
change is left for a following commit.
Epic: CRDB-42943
Release note: None
#### opt: add support for prefix columns to vector search rule
This commit adds support for prefix columns to the `GenerateVectorSearch`
optimizer rule. Select filters over the matched scan as well as check
constraint filters can be used if they constrain every prefix column to
single-key spans, like the following examples:
```
prefix1 = 1 AND prefix2 = 2
(prefix1, prefix2) IN ((1, 2), (3, 4))
```
Currently, additional filters beyond those used to constrain the
prefix are not yet supported. This will have to wait until the vector
index is able to stream results in approximate order of distance.
Fixes#143206
Release note: None
Co-authored-by: Drew Kimball <[email protected]>
0 commit comments