Queries against local vector indexes were failing with the error: "ANN ordering by vector requires the column to be indexed using 'vector_index'" This was a regression introduced by 15788c3734, which incorrectly assumed the first column in the targets list is always the vector column. For local vector indexes, the first column is the partition key, causing the failure. Previously, serialization logic for the target index option was shared between vector and secondary indexes. This is no longer viable due to the introduction of local vector indexes and vector indexes with filtering columns, which have different target format. This commit introduces a dedicated JSON-based serialization format for vector index targets, identifying the target column (tc), filtering columns (fc), and partition key columns (pk). This ensures unambiguous serialization and deserialization for all vector index types. This change is backward compatible for regular vector indexes. However, it breaks compatibility for local vector indexes and vector indexes with filtering columns created in version 2026.1.0. To mitigate this, usage of these specific index types will be blocked in the 2026.1.0 release by failing ANN queries against them in vector-store service. Fixes: SCYLLADB-895
825 B
825 B
Vector index in Scylla
Vector indexes are custom indexes (USING 'vector_index'). Their target option in system_schema.indexes uses following format:
- Simple single-column vector index
(v): just the (escaped) column name, e.g.v - Vector index with filtering columns
(v, f1, f2): JSON withtc(target column) andfc(filtering columns):{"tc":"v","fc":["f1","f2"]} - Local vector index
((p1, p2), v): JSON withtcandpk(partition key columns):{"tc":"v","pk":["p1","p2"]} - Local vector index with filtering columns
((p1, p2), v, f1, f2): JSON withtc,pk, andfc:{"tc":"v","pk":["p1","p2"],"fc":["f1","f2"]}
The target option acts as the interface for the vector-store service, providing the metadata necessary to determine which columns are indexed and how they are structured.