An orders container in Azure Cosmos DB for NoSQL uses the default indexing policy and has no composite indexes. A developer runs the following query with index metrics enabled:
SELECT c.id, c.status FROM c WHERE c.customerId = @customerId AND c.orderDate > @startDate
The exhibit shows the index metrics that are returned.
Index Utilization Information Utilized Single Indexes Index Spec: /customerId/? Index Impact Score: High --- Index Spec: /orderDate/? Index Impact Score: High --- Potential Single Indexes Utilized Composite Indexes Potential Composite Indexes Index Spec: /customerId ASC, /orderDate ASC Index Impact Score: High ---
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
| Statement | Yes | No |
|---|---|---|
| The query was served by a composite index on /customerId and /orderDate. The Utilized Composite Indexes section is empty. The composite index appears only under Potential Composite Indexes, which lists indexes the query might use if they were added. | Correct | |
| The metrics show that the query used the /customerId/? and /orderDate/? indexed paths. Both paths are listed under Utilized Single Indexes, and utilized paths are evidence that the query used them. | Correct | |
| The metrics prove that adding the composite index (/customerId ASC, /orderDate ASC) will reduce the query's request charge. Potential indexed paths are recommendations, not conclusive evidence, and some may have no effect on performance. The index must be added and the query's charge compared with the baseline. | Correct |
The index metrics output has four sections. The utilized sections record which indexes the query actually used, so here it used the two single-path indexes and no composite index. The potential composite index is a recommendation for an index the query might use if it existed. A High score on that recommendation still has to be confirmed by adding the index and comparing the request charge with the recorded baseline.