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/troubleshoot-query-performance.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ This article provides examples that you can re-create by using the [nutrition](h
32
32
- The number of items in a page can and will change without notice.
33
33
- Empty pages are expected for queries and can appear at any time.
34
34
- Empty pages are exposed in the SDKs because that exposure allows more opportunities to cancel a query. It also makes it clear that the SDK is doing multiple network calls.
35
-
- Empty pages can appear in existing workloads because a physical partition is split in Azure Cosmos DB. The first partition now has zero results, which causes the empty page.
35
+
- Empty pages can appear in existing workloads because a physical partition is split in Azure Cosmos DB. The first partition will have zero results, which causes the empty page.
36
36
- Empty pages are caused by the backend preempting a query because the query is taking more than some fixed amount of time on the backend to retrieve the documents. If Azure Cosmos DB preempts a query, it will return a continuation token that will allow the query to continue.
37
37
- Be sure to drain the query completely. Look at the SDK samples, and use a `while` loop on `FeedIterator.HasMoreResults` to drain the entire query.
38
38
@@ -42,7 +42,7 @@ When you optimize a query in Azure Cosmos DB, the first step is always to [get t
After you get the query metrics, compare the Retrieved Document Count with the Output Document Count for your query. Use this comparison to identify the relevant sections to reference in this article.
45
+
After you get the query metrics, compare the Retrieved Document Count with the Output Document Count for your query. Use this comparison to identify the relevant sections to review in this article.
46
46
47
47
The Retrieved Document Count is the number of documents that the query needed to load. The Output Document Count is the number of documents that were needed for the results of the query. If the Retrieved Document Count is significantly higher than the Output Document Count, there was at least one part of your query that was unable to use the index and needed to do a scan.
48
48
@@ -86,7 +86,7 @@ Refer to the following sections to understand the relevant query optimizations f
86
86
87
87
The Retrieved Document Count is the number of documents that the query needed to load. The Output Document Count is the number of documents that were needed for the results of the query. If the Retrieved Document Count is significantly higher than the Output Document Count, there was at least one part of your query that was unable to use the index and needed to do a scan.
88
88
89
-
Here's an example of scan query that wasn't entirely served by the index.
89
+
Here's an example of scan query that wasn't entirely served by the index:
90
90
91
91
Query:
92
92
@@ -291,7 +291,7 @@ AND n.nutritionValue < 10) AND s.amount > 1
291
291
292
292
For this query, the index will match any document that has a tag with the name "infant formula", nutritionValue greater than 0, and serving amount greater than 1. The `JOIN` expression here will perform the cross-product of all items of tags, nutrients, and servings arrays for each matching document before any filter is applied. The `WHERE` clause will then apply the filter predicate on each `<c, t, n, s>` tuple.
293
293
294
-
For example, if a matching document had 10 items in each of the three arrays, it will expand to 1 x 10 x 10 x 10 (that is, 1,000) tuples. The use of subqueries here can help to filter out joined array items before joining with the next expression.
294
+
For example, if a matching document has 10 items in each of the three arrays, it will expand to 1 x 10 x 10 x 10 (that is, 1,000) tuples. The use of subqueries here can help to filter out joined array items before joining with the next expression.
295
295
296
296
This query is equivalent to the preceding one but uses subqueries:
297
297
@@ -305,7 +305,7 @@ JOIN (SELECT VALUE s FROM s IN c.servings WHERE s.amount > 1)
305
305
306
306
**RU charge:** 22.17 RUs
307
307
308
-
Assume that only one item in the tags array matches the filter and that there are five items for both the nutrients and servings arrays. The `JOIN` expressions will then expand to 1 x 1 x 5 x 5 = 25 items, as opposed to 1,000 items in the first query.
308
+
Assume that only one item in the tags array matches the filter and that there are five items for both the nutrients and servings arrays. The `JOIN` expressions will expand to 1 x 1 x 5 x 5 = 25 items, as opposed to 1,000 items in the first query.
309
309
310
310
## Queries where Retrieved Document Count is equal to Output Document Count
311
311
@@ -317,7 +317,7 @@ Azure Cosmos DB uses [partitioning](partitioning-overview.md) to scale individua
317
317
318
318
If you have a large number of provisioned RUs (more than 30,000) or a large amount of data stored (more than approximately 100 GB), you probably have a large enough container to see a significant reduction in query RU charges.
319
319
320
-
For example, if you create a container with the partition key foodGroup, the following queries would need to check only a single physical partition:
320
+
For example, if you create a container with the partition key foodGroup, the following queries will need to check only a single physical partition:
0 commit comments