Create the native index that powers VECTOR_DISTANCE, or remove that read path without deleting a base-table item. Both statements lower to UpdateTable.VectorIndexUpdates, and both use live DescribeTable metadata to fail closed before the wire.
Syntax
sql
CREATE VECTOR INDEX "index" ON "table" (vector_attribute) DIMENSIONS 1..4096 DISTANCE COSINE | EUCLIDEAN | DOT_PRODUCT [PARTITION BY (hash_attribute)] [FILTER BY (inline_filter_attribute, …)] PROJECT ALL | KEYS | (attribute, …);DROP VECTOR INDEX "index" ON "table";
Vector — exactly one top-level vector attribute and 1–4096 dimensions.
Distance — COSINE, EUCLIDEAN, or DOT_PRODUCT.
PARTITION BY — optional, at most one attribute. It becomes the HASH SearchSchema field that every search must pin with equality.
FILTER BY — optional, up to 18 attributes. They become INLINE_FILTER fields accepted as optional equality filters.
PROJECT — ALL, KEYS, or 1–20 included attributes. Include fields a search returns; the vector and SearchSchema fields are intrinsic and must not be repeated in the include list.
Names — table and index names are 3–255 characters and may contain letters, numbers, underscore, hyphen, and period.
The vector attribute cannot also be a SearchSchema attribute; an attribute cannot appear in both PARTITION BY and FILTER BY; duplicate attributes are refused. The editor completes this grammar clause by clause and uses the connected descriptor for table, index, attribute, dimensions, metric, projection, and readiness suggestions.
Live requirements and lifecycle
Professional — creating and dropping vector indexes are Professional capabilities.
Fresh metadata — create and drop require a complete, current DescribeTable; a missing or stale descriptor never becomes an optimistic write.
On-demand table — create requires ON_DEMAND billing. A provisioned table refuses with the exact fix.
Table limits — the index name must be new, the table may have at most five vector indexes, and indexes sharing one vector attribute must use the same DIMENSIONS value.
Double-run confirmation — the first Run validates and arms the operation; the second unchanged Run dispatches it.
Asynchronous receipt — create is tracked through descriptor appearance and backfill to ready (ACTIVE with Backfilling cleared). Drop is tracked until the descriptor disappears. Accepted DDL invalidates the metadata cache immediately.
Use cases
Search within one categoryLowered
Product embeddings are 1,536-dimensional. Every search belongs to one category, may filter by brand or status, and returns only product identity and display fields.
sql
CREATE VECTOR INDEX "ProductEmbeddingIndex" ON "Products" (Embedding) DIMENSIONS 1536 DISTANCE COSINE PARTITION BY (Category) FILTER BY (Brand, Status) PROJECT (ProductId, Title, Price)