Skip to content

sql: add cluster setting to tune sql stats cleanup job behavior#80191

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
Azhng:sqlstats-tune-128
Apr 20, 2022
Merged

sql: add cluster setting to tune sql stats cleanup job behavior#80191
craig[bot] merged 1 commit intocockroachdb:masterfrom
Azhng:sqlstats-tune-128

Conversation

@Azhng
Copy link
Copy Markdown
Contributor

@Azhng Azhng commented Apr 19, 2022

Related to #79548

Previously, SQL Stats cleanup job was configured to break the
delete operation into many small transactions. Each transaction could
only delete up to 128 rows. This number was hardcoded and has shown to
be problematic when there are large number of MVCC garbages.
This commit changes this value into a new non-public cluster
settings sql.stats.cleanup.rows_to_delete_per_txn with default value
being 1024. The higher default value is bumped higher in order to
amortize the cost of scanning over large amount of MVCC garbage.

Release note: None

Related to cockroachdb#79548

Previously, SQL Stats cleanup job was configured to break the
delete operation into many small transactions. Each transaction could
only delete up to 128 rows. This number was hardcoded and has shown to
be problematic when there are large number of MVCC garbages.
This commit changes this value into a new non-public cluster
settings `sql.stats.cleanup.rows_to_delete_per_txn` with default value
being 1024. The higher default value is bumped higher in order to
amortize the cost of scanning over large amount of MVCC garbage.

Release note: None
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@Azhng Azhng requested review from a team and mgartner April 19, 2022 21:15
@Azhng Azhng marked this pull request as ready for review April 19, 2022 21:15
Copy link
Copy Markdown
Contributor

@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.

:lgtm:

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

@Azhng
Copy link
Copy Markdown
Contributor Author

Azhng commented Apr 20, 2022

TFTR!

bors r+

Copy link
Copy Markdown
Contributor

@mgartner mgartner left a comment

Choose a reason for hiding this comment

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

Thanks!

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Apr 20, 2022

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.

4 participants