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

sql: do not collect stats so frequently for small tables with lots of updates #107559

Open
mgartner opened this issue Jul 25, 2023 · 1 comment
Open
Labels
A-sql-table-stats Table statistics (and their automatic refresh). C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-queries SQL Queries Team

Comments

@mgartner
Copy link
Collaborator

mgartner commented Jul 25, 2023

If a small table gets UPDATEd frequently, auto-stats collection can occur very frequently. In one real-world case, we've seen an auto-stats jobs started every 1-2 minutes for a table. This is a lot of extra work and puts unnecessary pressure on the jobs system. How can we make stats collection less frequent on these types of tables?

Jira issue: CRDB-30108

@mgartner mgartner added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Jul 25, 2023
@michae2 michae2 added the A-sql-table-stats Table statistics (and their automatic refresh). label Jul 25, 2023
@michae2
Copy link
Collaborator

michae2 commented Jul 25, 2023

IMO for these frequently-churning tables we should disable histograms and use a much higher proportion of changed rows to decide when to automatically collect statistics (maybe something > 100%).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-table-stats Table statistics (and their automatic refresh). C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-queries SQL Queries Team
Projects
Status: Backlog
Development

No branches or pull requests

3 participants