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

sqlstats: increase default value for deleted rows #97642

Merged
merged 1 commit into from
Feb 27, 2023

Conversation

maryliag
Copy link
Contributor

@maryliag maryliag commented Feb 24, 2023

During the sql stats compaction job, we limit the amount of rows being deleted per transaction. We used a default value of 1024, but we have been increasinly seeing customer needing to increase this value to allow the job to keep up with the large amount of data being flushed.
We have been recommening a value for 20k, so being more conservative with the default (plus the changes on #97123 that won't let tables get in a state with so many rows), this commit changes the value to 10k.

Fixes #97528

Release note (sql change): Increase the default value of sql.stats.cleanup.rows_to_delete_per_txn to 10k, to increase efficiency of the cleanup job for sql statistics.

@maryliag maryliag requested a review from a team February 24, 2023 18:36
@blathers-crl
Copy link

blathers-crl bot commented Feb 24, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

During the sql stats compaction job, we limit the amount of
rows being deleted per transaction. We used a default value
of 1024, but we have been increasinly seeing customer needing
to increase this value to allow the job to keep up with the
large amount of data being flushed.
We have been recommening a value for 20k, so being more
conservative with the default (plus the changes on cockroachdb#97123
that won't let tables get in a state with so many rows),
this commit changes the value to 10k.

Fixes cockroachdb#97528

Release note (sql change): Increase the default value of
`sql.stats.cleanup.rows_to_delete_per_txn` to 10k, to increase
efficiency of the cleanup job for sql statistics.
@maryliag maryliag force-pushed the increase-txn-delete branch from 1318e4e to ce9f3b6 Compare February 24, 2023 18:38
@xinhaoz
Copy link
Member

xinhaoz commented Feb 27, 2023

Just curious, how did we decide on 10k? DId we test this value under a workload?

Copy link
Contributor

@j82w j82w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @maryliag)


-- commits line 17 at r1:
Should we create an issue to make this dynamic in the future? Have a min and max value. Then have the actual number change based on the time it take to deletes the rows, or some other metric where it would be better to have a smaller number.

Copy link
Contributor Author

@maryliag maryliag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how did we decide on 10k?

During escalations we did testing with heavy workloads and have been recommending users to change to 20k instead (as I mentioned on the PR description). Since the majority of users won't have a workload so heavy, I chose a little more conservative value of half our recommendation, so 10k, which is already 10x better the current default value.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @j82w)


-- commits line 17 at r1:

Previously, j82w (Jake) wrote…

Should we create an issue to make this dynamic in the future? Have a min and max value. Then have the actual number change based on the time it take to deletes the rows, or some other metric where it would be better to have a smaller number.

issue created: #97712

Code quote:

sql.stats.cleanup.rows_to_delete_per_txn

@maryliag
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Feb 27, 2023

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

increase default value of sql.stats.cleanup.rows_to_delete_per_txn
4 participants