Azure Cosmos DB for NoSQL データベースがあり、その中に Container1 という名前のコンテナが存在します。 Container1には製品の詳細情報が格納されています。 Query1 という名前のクエリがあり、その中に以下のステートメントが含まれています。 SELECT p.ProductGroup, p.Color 製品AS pから WHERE p.ProductName = "100mm リターンバルブ" かつ p.ListPrice > 120 カスタムインデックスを使用して、Query1のパフォーマンスを最適化する必要があります。 どのインデックスコンポーネントの組み合わせがQuery1を最適化しますか?
正解:D
Define a Composite Index: Configure a composite index that includes the properties in your WHERE and AND clauses. The order of the properties in the composite index definition should generally match the order in your query's clauses to be most effective. Note: To optimize an Azure Cosmos DB for NoSQL query using a composite index, your index definition must precisely align with the properties and sequence of your filters. For example, an order details container, consider this example query: SELECT * FROM c WHERE c.customerId = "C123" AND c.orderStatus = "Shipped" ORDER BY c.orderDate DESC Effective Composite Index Design To ensure the query is served by the index rather than a scan, your index should follow these rules: Sequence Matters: The properties in your composite index must appear in the exact order they are used in the WHERE and ORDER BY clauses. Filter Logic: Include all properties used in your WHERE filters (joined by AND). Sort Integration: If you have an ORDER BY clause, those properties must come after the equality filters in the index definition. Order Match: The ascending/descending order in the index definition must match the query for multiple-property sorting. Example Index Definition: Property 1: /customerId (Ascending) Property 2: /orderStatus (Ascending) Property 3: /orderDate (Descending) Reference: https://oneuptime.com/blog/post/2026-02-02-keyset-pagination/view