You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/nosql/performance-tips-query-sdk.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -361,9 +361,9 @@ Pre-fetching works the same way regardless of the degree of parallelism, and the
361
361
362
362
## Optimizing single partition queries with Optimistic Direct Execution
363
363
364
-
Azure Cosmos DB NoSQL has an optimization called Optimistic Direct Execution (ODE), which can improve the efficiencyof certain NoSQL queries. Specifically, queries that don’t require distribution include those that can be executed on a single physical partition, or have responses that do not require [pagination](query/pagination.md). Queries that don’t require distribution can confidently skip some processes, such as client-side query plan generation and query rewrite, thereby reducing query latnecy and RU cost. If you specify the partition key in the request or query itself (or have only one physical partition), and the results of your query don’t require pagination, then ODE can improve your queries.
364
+
Azure Cosmos DB NoSQL has an optimization called Optimistic Direct Execution (ODE), which can improve the efficiency of certain NoSQL queries. Specifically, queries that don’t require distribution include those that can be executed on a single physical partition or that have responses that don't require [pagination](query/pagination.md). Queries that don’t require distribution can confidently skip some processes, such as client-side query plan generation and query rewrite, thereby reducing query latency and RU cost. If you specify the partition key in the request or query itself (or have only one physical partition), and the results of your query don’t require pagination, then ODE can improve your queries.
365
365
366
-
Single partition queries that feature GROUP BY, ORDER BY, DISTINCT, and aggregation functions (sum, mean, min, max, etc.) can significantly benefit from using ODE. However, in scenarios where the query is targeting multiple partitions, or still requires pagination, the latency of the query response and RU cost may be higher than without using ODE. Therefore, when using ODE, it’s recommended to:
366
+
Single partition queries that feature GROUP BY, ORDER BY, DISTINCT, and aggregation functions (like sum, mean, min, and max) can significantly benefit from using ODE. However, in scenarios where the query is targeting multiple partitions or still requires pagination, the latency of the query response and RU cost might be higher than without using ODE. Therefore, when using ODE, we recommend to:
367
367
- Specify the partition key in the call or query itself.
368
368
- Ensure that your data size hasn’t grown and caused the partition to split.
369
369
- Ensure that your query results don’t require pagination to get the full benefit of ODE.
@@ -394,7 +394,7 @@ Some complex queries can always require distribution, even if targeting a single
394
394
- SELECT Avg(1) AS avg FROM root r
395
395
```
396
396
397
-
It’s important to note that: ODE may not always retrieve the query plan and as a result is not able disallow or turn off for unsupported queries. For example, after partition split, such queries are no longer eligible for ODE and therefore will not run since client-side query plan evaluation will block those. To ensure compatibility/service continuity, it's critical to ensure that only queries that are fully supported in scenarios without ODE (that is, the execute and produce the correct result in the general multi-partition case) are used with ODE.
397
+
It's important to note that ODE might not always retrieve the query plan and, as a result, is not able to disallow or turn off for unsupported queries. For example, after partition split, such queries are no longer eligible for ODE and, therefore, won't run because client-side query plan evaluation will block those. To ensure compatibility/service continuity, it's critical to ensure that only queries that are fully supported in scenarios without ODE (that is, they execute and produce the correct result in the general multi-partition case) are used with ODE.
398
398
399
399
### Using ODE via the SDKs
400
400
ODE is now available and enabled by default in the C# Preview SDK for versions 3.35.0 and later. When you execute a query and specify a partition key in the request or query itself, or your database has only one physical partition, your query execution can leverage the benefits of ODE.
0 commit comments