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

statistics background update in-memory objects worker reads a lot of unneeded items from storage #57905

Closed
winoros opened this issue Dec 3, 2024 · 1 comment
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.

Comments

@winoros
Copy link
Member

winoros commented Dec 3, 2024

Enhancement

From #57631 (comment), we'll see that TiDB reads all the stats_meta whose last_update_version is higher than the given timestamp.
And it's not the end. It will then call TableStatsFromStorage for every table_id read from stats_meta and read all the things from mysql.stats_histogram, mysql.stats_top_n and mysql.stats_buckets.
It's a big waste since most of the tables are just updating the row count and modified_count and rare of them will be analyzed.
We need a more accurate control for the background worker to only read the things really needed to update the in-memory stats objects.

@winoros winoros added type/enhancement The issue or PR belongs to an enhancement. sig/planner SIG: Planner labels Dec 3, 2024
@Rustin170506
Copy link
Member

duplicate of #57868

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

2 participants