Skip to content

CREATE VECTOR INDEX works; the skill said it did not - #150

Open
Carlos Robles (croblesm) wants to merge 1 commit into
mainfrom
fix-vector-index-claim
Open

CREATE VECTOR INDEX works; the skill said it did not#150
Carlos Robles (croblesm) wants to merge 1 commit into
mainfrom
fix-vector-index-claim

Conversation

@croblesm

Copy link
Copy Markdown
Collaborator

azuresql-db-rag tells readers that CREATE VECTOR INDEX is "still in development in this preview" and to not rely on it. That is no longer true, and the skill is steering people away from a feature that works.

Measured

2026-08-29, against 12.0.2000.8, EngineEdition 5, image azure-sql/db-dev:latest:

  • An index over 2000 rows of VECTOR(3) built in 478 ms.
  • It appears in sys.indexes with type_desc of VECTOR.
  • vector_search(...) returns ranked results against it.

Two obstacles replace the old warning, and neither error names its own cause

SET QUOTED_IDENTIFIER ON is required, and it is off by default in a sqlcmd session. Without it:

Msg 1934: CREATE VECTOR INDEX failed because the following SET options have incorrect
settings: 'QUOTED_IDENTIFIER'. Verify that SET options are correct for use with indexed
views and/or indexes on computed columns and/or filtered indexes and/or query
notifications and/or XML data type methods and/or spatial index operations.

Everything that message names is irrelevant here, and the setting that actually caused it is not mentioned. A reader hitting this concludes the feature is broken, which is exactly what the skill already told them to expect.

TOP_N is rejected once the index exists. vector_search(...) with an explicit TOP_N fails with Msg 42274, Vector search with newer index version does not support explicit TOP_N parameter. Use SELECT TOP (k) with ORDER BY s.distance.

What is kept

Full-scan top-k with ORDER BY VECTOR_DISTANCE(...) is still exact and still the right choice for a small table, so that guidance stays. The index is now presented as the choice once a full scan starts to hurt, rather than as something unavailable.

Changed in skills/azuresql-db-rag/SKILL.md (the description, the indexing section, and the do-not list) and in references/vector-schema.md.

azuresql-db-rag told readers the vector index was "still in development" and to
not rely on it. Measured on 2026-08-29 against 12.0.2000.8, EngineEdition 5: an
index over 2000 rows of VECTOR(3) built in 478 ms, appears in sys.indexes with
type_desc VECTOR, and vector_search() returns ranked results against it.

Two real obstacles replace the old warning, because neither error names its own
cause:

SET QUOTED_IDENTIFIER ON is required and is off by default in sqlcmd. Without it
the statement fails with Msg 1934, whose text lists indexed views, computed
columns, filtered indexes, query notifications, XML methods and spatial indexes,
and never mentions the session setting responsible.

Once the index exists, vector_search() rejects an explicit TOP_N with Msg 42274.
Use SELECT TOP (k) with ORDER BY s.distance.

Full-scan top-k stays exact and stays the right choice for a small table, so the
guidance to use it is kept rather than removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant