Skip to content

Commit 2af6ed9

Browse files
Slightly modified changes based on Florence's feedback
1 parent 1674f4f commit 2af6ed9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/current/v25.4/troubleshoot-query-plan-regressions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ For any given SQL statement, if the [cost-based optimizer]({% link {{page.versio
1616

1717
## What to look out for
1818

19-
Query plan regressions only increase the execution time of SQL statements that use that plan. This means that the overall service latency of the cluster will only be affected during the execution of statements that are run with the problematic query plan.
19+
Query plan regressions only increase the execution time of SQL statements that use the affected plan. This means that the overall service latency of the cluster will only be affected during the execution of statements that are run with the problematic query plan.
2020

21-
This might make those latency spikes harder to identify. For example, if the problematic plan only affects a query that's run on an infrequent, ad-hoc basis, it might be difficult to notice a pattern among the graphs on the [**Metrics** page]({% link {{page.version.version}}/ui-overview.md %}#metrics).
21+
As a result, these latency spikes can be hard to identify. For example, if the problematic plan only affects a query that's run on an infrequent, ad-hoc basis, it might be difficult to notice a pattern among the graphs on the [**Metrics** page]({% link {{page.version.version}}/ui-overview.md %}#metrics).
2222

2323
To identify and fix query plan regressions, you must determine whether certain statement executions are associated with increased service latency. Next, check whether the statement’s query plan has changed. Finally, use CockroachDB's tools to understand why the query plan changed, so you can confirm that the change directly caused the latency increase.
2424

@@ -30,9 +30,9 @@ You might not be certain whether any particular SQL statement has experienced a
3030

3131
#### Notice a recent latency increase in your application
3232

33-
If you observe that your application is responding more slowly than usual, and this behavior hasn't been explained by recent changes to table schemas or data, or by changes to cluster workloads, it's worth considering a query plan regression.
33+
If you observe that your application is responding more slowly than usual, and this behavior isn’t explained by recent changes to table schemas, data, or cluster workloads, it's worth considering a query plan regression.
3434

35-
If application performance slows at a particular time of day, note the time interval so that you can isolate SQL statements that tend to run in that interval.
35+
If performance slows at a particular time of day, note the time interval to help isolate SQL statements that typically run during that time.
3636

3737
If instead the latency is associated with a particular action (for example, adding a new user), note the action. Then search through your application's codebase to isolate SQL queries associated with that action.
3838

@@ -78,12 +78,12 @@ For each suspect SQL statement, determine whether the high latency is caused by
7878
5. Note which query plan was in use just before the latency increase, and record the values in the **Plan Gist**, **Average Execution Time**, and **Average Rows Read** columns.
7979
6. Compare the query plans.
8080

81-
If the newer plan is the same as the older plan (if it has the same Plan Gist), then there was no query plan regression, because the plan hasn't changed.
81+
If the newer plan matches the older plan (i.e., it has the same **Plan Gist**), there was no query plan regression.
8282

8383
If the newer plan differs from the older plan, the query plan has changed:
8484

8585
- Compare the **Average Execution Time** of the two plans. If the newer plan’s average execution time is significantly higher than the older plan’s, it may indicate a query plan regression. It's also possible that the increase in latency is coincidental, or that the plan change was not the actual cause. If the average execution time is approximately the same, or less, this plan change is unlikely to be a regression.
86-
- Compare the **Average Rows Read** of the two plans. If the value for the newer plan is significantly higher than the value for the older plan (as in: an order of magnitude) it's very possible that this is due to a query plan regression. If the value for the newer plan is only moderately higher than the value for the older plan, it's possible that this is due to a query plan regression, but it's also possible that this is due to normal table growth. An increase in this value could be causing an increase in the average execution time.
86+
- Compare the **Average Rows Read** of the two plans. If the newer plan’s value is significantly higher (such as an order of magnitude greater), it likely indicates a query plan regression. If the value for the newer plan is only moderately higher than the value for the older plan, it's possible that this is due to a query plan regression, but it's also possible that this is due to normal table growth. This increase may contribute to higher average execution time.
8787
- For all of the query plan statistics in the table, consider whether the newer query plan's values are expected, based on your knowledge of the application and cluster workloads.
8888

8989
#### Multiple valid query plans

0 commit comments

Comments
 (0)