Skip to content

Commit d2f6178

Browse files
committed
update query troubleshooting guide
1 parent b92675a commit d2f6178

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

articles/cosmos-db/troubleshoot-query-performance.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,52 +20,53 @@ You can reference the below section to understand the relevant query optimizatio
2020

2121
### Query's RU charge is too high
2222

23-
<br>
2423
<br>
2524

2625
#### Loaded Document Count is significantly greater than Retrieved Document Count
2726

28-
a. [Ensure that the indexing policy includes necessary paths](troubleshoot-query-performance.md#Ensure-that-the-indexing-policy-includes-necessary-paths)
27+
a. [Ensure that the indexing policy includes necessary paths](#ensure-that-the-indexing-policy-includes-necessary-paths)
2928

30-
b. [Understand which system functions utilize the index](troubleshoot-query-performance.md#Understand-which-system-functions-utilize-the-index)
29+
b. [Understand which system functions utilize the index](#understand-which-system-functions-utilize-the-index)
3130

32-
c. [Optimize queries with both a filter and an ORDER BY clause](troubleshoot-query-performance.md#Optimize-queries-with-both-a-filter-and-an-ORDER-BY-clause)
31+
c. [Optimize queries with both a filter and an ORDER BY clause](#optimize-queries-with-both-a-filter-and-an-order-by-clause)
3332

34-
d. [Optimize queries that use DISTINCT](#Optimize-queries-that-use-DISTINCT)
33+
d. [Optimize queries that use DISTINCT](#optimize-queries-that-use-distinct)
3534

36-
e. [Optimize JOIN expressions by using a subquery](troubleshoot-query-performance.md#Optimize-JOIN-expressions-by-using-a-subquery)
35+
e. [Optimize JOIN expressions by using a subquery](#optimize-join-expressions-by-using-a-subquery)
3736

3837
<br>
3938

4039
#### Loaded Document Count is approximately equal to Retrieved Document Count
4140

42-
a. [Avoid cross partition queries](troubleshoot-query-performance.md#Avoid-cross-partition-queries)
41+
a. [Avoid cross partition queries](#Avoid-cross-partition-queries)
4342

44-
b. [Optimize queries that have a filter on multiple properties](troubleshoot-query-performance.md#Optimize-queries-that-have-a-filter-on-multiple-properties)
43+
b. [Optimize queries that have a filter on multiple properties](#optimize-queries-that-have-a-filter-on-multiple-properties)
4544

46-
c. [Optimize queries with both a filter and an ORDER BY clause](troubleshoot-query-performance.md#Optimize-queries-with-both-a-filter-and-an-ORDER-BY-clause)
45+
c. [Optimize queries with both a filter and an ORDER BY clause](#optimize-queries-with-both-a-filter-and-an-order-by-clause)
4746

4847
<br>
4948

5049
### Query's RU charge is acceptable but latency is still too high
5150

52-
a. [Improving proximity between your app and Azure Cosmos DB](troubleshoot-query-performance.md#Improving-proximity-between-your-app-and-Azure-Cosmos-DB)
51+
a. [Improving proximity between your app and Azure Cosmos DB](#improving-proximity-between-your-app-and-azure-cosmos-db)
5352

54-
b. [Increasing provisioned throughput](troubleshoot-query-performance.md#Increasing-provisioned-throughput)
53+
b. [Increasing provisioned throughput](#increasing-provisioned-throughput)
5554

56-
c. [Increasing MaxConcurrency](troubleshoot-query-performance.md#Increasing-MaxConcurrency)
55+
c. [Increasing MaxConcurrency](#increasing-maxconcurrency)
5756

58-
d. [Increasing MaxBufferedItemCount](troubleshoot-query-performance.md#Increasing-MaxBufferedItemCount)
57+
d. [Increasing MaxBufferedItemCount](#increasing-maxbuffereditemcount)
5958

6059
### Obtaining query metrics:
6160

62-
When optimizing a query in Azure Cosmos DB, the first step is always to [obtain the query metrics](https://docs.microsoft.com/en-us/azure/cosmos-db/sql-api-sql-query-metrics#query-execution-metrics) for your query These are also available through the Azure Portal as shown below:
61+
When optimizing a query in Azure Cosmos DB, the first step is always to [obtain the query metrics](sql-api-sql-query-metrics.md#query-execution-metrics) for your query. These are also available through the Azure Portal as shown below:
6362

6463
![Obtaining query metrics](./media/troubleshoot-query-performance/obtain-query-metrics.jpg)
6564

65+
After obtaining query metrics, compare the Retrieved Document Count with the Loaded Document Count for your query. Use this comparison to identify the relevant sections to reference below.
66+
6667
## Optimizations for queries where Loaded Document Count significantly exceeds Retrieved Document Count:
6768

68-
After obtaining query metrics, compare the Retrieved Document Count with the Loaded Document Count for your query. The Retrieved Document Count is the number of documents that will show up in the results of your query. The Loaded Document Count is the number of documents that needed to be scanned. If the Loaded Document Count is significantly higher than the Retrieved Document Count, then there was at least one part of your query that was unable to utilize the index.
69+
The Retrieved Document Count is the number of documents that will show up in the results of your query. The Loaded Document Count is the number of documents that needed to be scanned. If the Loaded Document Count is significantly higher than the Retrieved Document Count, then there was at least one part of your query that was unable to utilize the index.
6970

7071
## Ensure that the indexing policy includes necessary paths
7172

0 commit comments

Comments
 (0)