QuestionQ12

Develop AI solutions by using Azure data management services

An application runs similarity searches across 5 million embeddings kept in Azure Database for PostgreSQL with pgvector. Queries frequently filter by department before they rank results by cosine distance.

P95 latency for vector similarity queries is above the SLA target. Monitoring indicates sustained high CPU utilization during query execution.

You need to lower P95 latency for filtered vector similarity queries.

What should you do?

  • A Create B-tree indexes on frequently filtered metadata columns.
  • B Store embeddings as JSON.
  • C Increase embedding dimensionality.
  • D Increase statement timeout.
Explanation

A B-tree index on a frequently filtered scalar metadata column such as department can efficiently narrow the candidate rows before cosine-distance ranking. Reducing the rows that must be considered lowers CPU work and improves latency for this filter pattern. Azure guidance also recommends indexing and query-plan optimization to improve pgvector search performance.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!