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: use clear range to clean tables during rollback of create #79543

Merged
merged 1 commit into from
Apr 7, 2022

Conversation

fqazi
Copy link
Collaborator

@fqazi fqazi commented Apr 6, 2022

Fixes: #79123

Previously, when dropping a table during rollback of a create
we would clean up table data in chunks instead of doing a
clear range. This was inadequate because he code path in
question existed for compatibility Cockroach 1.1 and had terrible
performance characteristics for large tables. To address,
this patch will always use delete data using clear range when
dropping tables during rollback which will have better performance.

Release note (performance improvement): Rollback of CREATE
TABLE AS with large quantities of data has similar performance
to regular DROP TABLE.

@fqazi fqazi requested a review from a team April 6, 2022 21:26
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Fixes: cockroachdb#79123

Previously, when dropping a table during rollback of a create
we would clean up table data in chunks instead of doing a
clear range. This was inadequate because he code path in
question existed for compatibility Cockroach 1.1 and had terrible
performance characteristics for large tables. To address,
this patch will always use delete data using clear range when
dropping tables during rollback which will have better performance.

Release note (performance improvement): Rollback of CREATE
TABLE AS with large quantities of data has similar performance
to regular DROP TABLE.
Copy link
Contributor

@ajwerner ajwerner 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 3 of 3 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @fqazi)

@fqazi
Copy link
Collaborator Author

fqazi commented Apr 7, 2022

@ajwerner TFTR!

@fqazi
Copy link
Collaborator Author

fqazi commented Apr 7, 2022

bors r+

@craig
Copy link
Contributor

craig bot commented Apr 7, 2022

Build succeeded:

@fqazi
Copy link
Collaborator Author

fqazi commented Apr 7, 2022

blathers backport 22.1 21.2

@blathers-crl
Copy link

blathers-crl bot commented Apr 7, 2022

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from 742d6fe to blathers/backport-release-21.2-79543: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 21.2 failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-21.2.x 21.2 is EOL backport-22.1.x 22.1 is EOL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql: rollback of create table hits slow path for table deletion
3 participants