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

The efficiency of auto analyze is low with auto_analyze_priority_queue and infoSchemaV2 open in million tables scenario #54086

Open
lilinghai opened this issue Jun 18, 2024 · 0 comments
Labels
feature/developing the related feature is in development may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 may-affects-8.1 severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@lilinghai
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

tidb_schema_cache_size 2GB
create 100k schemas and about 15 tables each of schema. 1.5 million tables totally
insert data for above tables
It takes about 10 minutes to execute a single analyze task on average when auto_analyze_priority_queue and infoSchemaV2 open. While 20 analyze tasks are executed per minute when auto_analyze_priority_queue or infoSchemaV2 close.
Currently, the automatic statistics collection task priority queue feature retrieves all table information each time it performs an analyze, selecting one from them to execute. If some tables are not in the infoschema cache, this process is quite time-consuming.
image

2. What did you expect to see? (Required)

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

Release Version: v8.2.0-alpha
Edition: Community
Git Commit Hash: 6cf8776
Git Branch: heads/refs/tags/v8.2.0-alpha
UTC Build Time: 2024-06-13 11:49:48
GoVersion: go1.21.10
Race Enabled: false
Check Table Before Drop: false
Store: tikv

@lilinghai lilinghai added the type/bug The issue is confirmed as a bug. label Jun 18, 2024
@jebter jebter added sig/planner SIG: Planner severity/major feature/developing the related feature is in development labels Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/developing the related feature is in development may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 may-affects-8.1 severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants