You have a Microsoft SQL Server 2025 database that contains a table named products. products contains two columns named description and embedding. embedding is generated from description.
You have an application named App1. App1 has a feature that uses the following query.
VECTOR_DISTANCE('cosine', @query_vector, embedding)
Users report that the feature is slow during peak usage times.
You discover that during peak usage times, the semantic search latency increases and CPU utilization spikes.
You need to reduce latency and CPU utilization related to the App1 feature.
What should you do?
The correct answer is C because the current query uses VECTOR_DISTANCE('cosine', @query_vector, embedding), which performs an exact vector distance calculation. Microsoft explicitly documents that VECTOR_DISTANCE does not use a vector index, even when one exists. Exact k-nearest-neighbor searches can require scanning large numbers of vectors and calculating distances row by row, which explains the observed CPU spikes and increased semantic-search latency during peak load.
A vector index on products.embedding is specifically designed to accelerate nearest-neighbor search, and VECTOR_SEARCH is the Transact-SQL function that can use that approximate nearest-neighbor index when the index metric matches the query metric. Using METRIC = 'cosine' preserves the same similarity metric currently used by App1 while reducing the amount of computation required.
The other choices are incorrect:
A normalizes vectors but does not replace the expensive exact search with indexed ANN retrieval.
B replaces semantic vector search with lexical full-text search and changes the feature's behavior.
D a standard nonclustered B-tree index cannot accelerate vector-distance operations.
E converting embeddings to VARBINARY(8000) removes native vector semantics and does not solve the performance problem.
Therefore, the exam-aligned solution is create a vector index and use VECTOR_SEARCH with cosine distance.
Currently there are no comments in this discussion, be the first to comment!