Plan and manage an Azure AI solution 1.3 Manage, monitor, and secure AI systems

Overall query volume on an Azure AI Search service is low, but one complex query that…

Study guide skill: Monitor data ingestion quality, search index health, and relevance performance

Question B6-010

Overall query volume on an Azure AI Search service is low, but one complex query that matches many documents and computes facet counts over a large number of documents is consistently slow. Which change is most likely to help?

Select one answer.

  • A Page through the results with a high $skip value
  • B Rewrite the query as a regular expression query
  • C Add replicas
  • D Add partitions ✓ Correct answer

Answer: D

When one query takes too long, adding replicas won't help, but more partitions might, because partitions split data across more computing resources and low-selectivity queries and large facet counts can benefit from parallelization. Replicas help when performance slows down in general under load. High $skip values and regular expression queries increase the work per request.

Deep dive

How it works

Azure AI Search scales in two directions, and they solve different problems:

  • Replicas add capacity to the service as a whole.
  • Partitions split the data across extra computing resources. Two partitions split it in half, three into thirds, and so on.

Microsoft's performance guidance addresses this exact case: if the problem is a single query that takes too long, adding replicas won't help, but more partitions might. A side effect of adding partitions is that slower queries sometimes run faster due to parallel computing. Microsoft has seen that parallelization on low-selectivity queries, such as queries that match many documents, or facets providing counts over a large number of documents. That's this query.

Facets have a cost of their own. Every faceted query needs aggregations, so only add facets you plan to render, and avoid requesting high facet counts unless you need them.

The other options, and when you'd use them

  • High $skip paging: A high $skip makes things worse. The engine retrieves and ranks more documents per request, and Microsoft recommends filtering instead.
  • Rewrite as a regular expression: Regex queries can be particularly expensive and need full index scans. They add work rather than remove it.
  • Add replicas: Replicas add overall capacity. Total volume here is low, and for one long-running query adding replicas won't help.

Exam tip

One slow, heavy query = partitions (parallelism). Many queries slow under load = replicas.

References

Last reviewed:

Ready to test yourself? The quiz asks this and every other AI-103 question, with instant feedback. Practice this in a quiz →

All Plan and manage questions · AI-103 study guide

Thanks for your feedback!