Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

design: Priority Queue for Auto Analyze #49018

Merged
merged 13 commits into from
Feb 18, 2024
Prev Previous commit
Next Next commit
Update for special events
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
Rustin170506 committed Dec 4, 2023
commit 9cb4ae7a30094e47c3b95a2e2c5d4c4e62a350e7
3 changes: 2 additions & 1 deletion docs/design/2023-11-29-priority-queue-for-auto-analyze.md
Original file line number Diff line number Diff line change
@@ -81,7 +81,8 @@ The above process is the current auto analyze process. We can see that the curre
Since we perform analysis tasks synchronously on a single point for each table, we need to carry out weighted sorting on the tables that need analysis.

1. We still use tidb_auto_analyze_ratio to determine if the table needs to be analyzed. The default value is 0.5. It means that auto-analyze is triggered when greater than 50% of the rows in a table have been modified.
2. If a table is added to the auto-analysis queue, a weight must be assigned to it to determine the execution order.
2. For special events, it is necessary to put the table into the priority queue. For example, the table has a new index but it hasn't been analyzed yet.
3. If a table is added to the auto-analysis queue, a weight must be assigned to it to determine the execution order.

Weight table:
| Name | Meaning | Weight |