|
1 | 1 | ---
|
2 |
| -title: "Query throttling (Microsoft Dataverse)| Microsoft Docs" |
| 2 | +title: "Query throttling (Microsoft Dataverse)" |
3 | 3 | description: "Read about how the server can throttle a query to reduce system performance impact and what you can do about it."
|
4 |
| -ms.custom: "" |
5 |
| -ms.date: 04/29/2021 |
6 |
| - |
7 |
| -ms.suite: "" |
8 |
| -ms.tgt_pltfrm: "" |
9 |
| -ms.topic: "article" |
| 4 | +ms.date: 06/04/2024 |
| 5 | +ms.topic: article |
10 | 6 | applies_to:
|
11 | 7 | - "Dynamics 365 (online)"
|
12 |
| -ms.assetid: fc3ade34-9c4e-4c33-88a4-aa3842c5eee1 |
13 |
| -caps.latest.revision: 78 |
14 |
| -author: "pnghub" |
| 8 | +author: pnghub |
15 | 9 | ms.subservice: dataverse-developer
|
16 |
| -ms.author: "gned" |
17 |
| -ms.reviewer: "pehecke" |
| 10 | +ms.author: gned |
| 11 | +ms.reviewer: pehecke |
18 | 12 | search.audienceType:
|
19 | 13 | - developer
|
20 | 14 | ---
|
21 | 15 |
|
22 | 16 | # Query throttling
|
23 | 17 |
|
24 |
| -If a specific query creates a disproportional load on the database storing |
25 |
| -Microsoft Dataverse data, it can starve the database of resources and negatively impact |
26 |
| -performance of all data operations. When this happens Dataverse can start |
27 |
| -throttling that particular query which would allow all other scenarios to |
28 |
| -perform normally. |
| 18 | +If a specific query creates a disproportional load on the database storing Microsoft Dataverse data, it can starve the database of resources and negatively impact performance of all data operations. When this happens, Dataverse starts throttling that particular query to allow all other scenarios to perform normally. |
29 | 19 |
|
30 |
| -The primary way in which *query throttling* is different from |
31 |
| -[Service protection API limits](api-limits.md) is |
32 |
| -query throttling targets a specific query that causes a performance degradation while |
33 |
| -leaving the rest of the traffic unaffected. If the throttled query |
34 |
| -originates from a non-interactive application, throttling is likely to not be |
35 |
| -noticeable for end-users. If the query originates from an interactive |
36 |
| -application it will affect users that exercise that particular scenario. |
| 20 | +The primary way in which *query throttling* is different from [Service protection API limits](api-limits.md) is |
| 21 | +query throttling targets a specific query that causes a performance degradation while leaving the rest of the traffic unaffected. If the throttled query originates from a non-interactive application, throttling is likely to not be noticeable for end-users. If the query originates from an interactive application, it affects users that exercise that particular scenario. |
37 | 22 |
|
38 | 23 | ## Query throttling behavior
|
39 | 24 |
|
40 | 25 | Throttling can manifest in three ways:
|
41 | 26 |
|
42 |
| -- A delay is introduced before each execution of the query, making the |
43 |
| - scenario that uses it slower |
44 |
| - |
| 27 | +- A delay is introduced before each execution of the query, making the scenario that uses it slower |
45 | 28 | - Some fraction of attempts to execute the query are failing with any of the following errors:
|
46 | 29 |
|
47 |
| -| **Error code** | **Hex code** | **Message** | |
48 |
| -|----------------|--------------|-----------------------------------------------------------------------------------------------------------------------------------| |
49 |
| -| \-2147187388 | 0x80048544 | This query cannot be executed because it conflicts with query throttling. Please refer to [Query throttling](query-throttling.md) | |
50 |
| -| \-2147187132 | 0x80048644 | This query cannot be executed because it conflicts with Query Throttling; the query uses a leading wildcard value in a filter condition, which will cause the query to be throttled more aggressively. Please refer to this document: https://go.microsoft.com/fwlink/?linkid=2162952 | |
51 |
| -| \-2147186876 | 0x80048744 | This query cannot be executed because it conflicts with Query Throttling; the query uses a computed column in a filter condition, which will cause the query to be throttled more aggressively. Please refer to this document: https://go.microsoft.com/fwlink/?linkid=2162952 | |
| 30 | +|Error code|Hex code|Message| |
| 31 | +|---|---|---| |
| 32 | +|`-2147187388`|`0x80048544`| `This query cannot be executed because it conflicts with query throttling.`| |
| 33 | +|`-2147187132`|`0x80048644`| `This query cannot be executed because it conflicts with Query Throttling; the query uses a leading wildcard value in a filter condition, which will cause the query to be throttled more aggressively.`| |
| 34 | +|`-2147186876`|`0x80048744`| `This query cannot be executed because it conflicts with Query Throttling; the query uses a computed column in a filter condition, which will cause the query to be throttled more aggressively.` | |
52 | 35 |
|
53 |
| -For more infromation about more agressively throttled query patterns like leading wild cards can be found in [Optimize performance using FetchXml](fetchxml/optimize-performance.md) |
| 36 | +For more information about more aggressively throttled query patterns like leading wild cards can be found in [Optimize performance using FetchXml](fetchxml/optimize-performance.md) and [Optimize performance using QueryExpression](org-service/queryexpression/optimize-performance.md) |
54 | 37 |
|
55 | 38 | ## Common causes
|
56 | 39 |
|
57 |
| -Most of the situations when query throttling is necessary fall into one of the |
58 |
| -two broad categories: |
| 40 | +Most of the situations when query throttling is necessary fall into one of these two broad categories: |
59 | 41 |
|
60 |
| -- Some query in a common interactive scenario, for example a saved query used |
61 |
| - in a grid or a query executed by a plug-in, is inefficient and requires a lot |
62 |
| - of database resources for each execution |
| 42 | +- Some query in a common interactive scenario, for example a saved query used in a grid or a query executed by a plug-in, is inefficient and requires a lot of database resources for each execution |
63 | 43 |
|
64 |
| -- An automated operation, for example data integration involving moving a |
65 |
| - large amount of data into or out of Dataverse, executes a query at a very |
66 |
| - high rate which consumes a lot of database resources in aggregate even if |
67 |
| - each execution is cheap |
| 44 | +- An automated operation, for example data integration involving moving a large amount of data into or out of Dataverse, executes a query at a high rate that consumes a lot of database resources in aggregate even if each execution is less expensive |
68 | 45 |
|
69 | 46 | ## How to avoid query throttling
|
70 | 47 |
|
71 |
| -Query throttling depends on the query and the scenario where it is executed but there are some common guidelines: |
72 |
| - |
73 |
| -- For slow low-frequency queries, typically used in interactive |
74 |
| - applications, the query structure needs to be changed to make it more |
75 |
| - efficient |
76 |
| - |
77 |
| - - Some common guidelines for improving the query performance can be found |
78 |
| - in [Optimize performance using FetchXml](fetchxml/optimize-performance.md) |
79 |
| - |
80 |
| -- For non-interactive applications the common ways to reduce the database load |
81 |
| - are: |
| 48 | +Query throttling depends on the query and the scenario where it's executed but there are some common guidelines: |
82 | 49 |
|
83 |
| - - If [ExecuteMultiple](xref:Microsoft.Xrm.Sdk.Messages.ExecuteMultipleRequest) (or another batching mechanism) is used, the batch |
84 |
| - size can be reduced |
| 50 | +- For slow low-frequency queries, typically used in interactive applications, the query structure needs to be changed to make it more efficient |
85 | 51 |
|
86 |
| - - If the application uses concurrency, the number of threads can be reduced |
| 52 | + - Some common guidelines for improving the query performance can be found in [Optimize performance using FetchXml](fetchxml/optimize-performance.md) |
87 | 53 |
|
88 |
| - - A delay between requests can be introduced to reduce the request rate |
89 |
| - when neither batching nor concurrency are used |
| 54 | +- For non-interactive applications the common ways to reduce the database load are: |
90 | 55 |
|
| 56 | + - When using [ExecuteMultiple](xref:Microsoft.Xrm.Sdk.Messages.ExecuteMultipleRequest) (or another batching mechanism), reduce the size of the batch |
| 57 | + - If the application is multi-threaded, reduce the number of concurrent threads |
| 58 | + - If you aren't using batching or concurrent requests, add a delay between requests to reduce the request rate |
0 commit comments