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

storage: reduce heap allocations in MVCCDeleteRange #53315

Open
petermattis opened this issue Aug 24, 2020 · 2 comments
Open

storage: reduce heap allocations in MVCCDeleteRange #53315

petermattis opened this issue Aug 24, 2020 · 2 comments
Labels
A-storage Relating to our storage engine (Pebble) on-disk storage. C-performance Perf of queries or internals. Solution not expected to change functional behavior. T-storage Storage Team
Projects

Comments

@petermattis
Copy link
Collaborator

petermattis commented Aug 24, 2020

Spun out of #53192.

MVCCDeleteRange is implemented via MVCCScan followed by MVCCDelete for each of the returned keys. This is inefficient for three reasons. First, we're using MVCCScan which returns a []roachpb.KeyValue. We could instead use MVCCScanToBytes. Second, we're buffering the values of the keys to delete, but we do not actually need the values. This could be alleviated by adding a new MVCCScanOption that indicates only keys are needed. Third, we're buffering all of the keys to be deleted. This last problem is the hardest to deal with, but with appropriate pebbleMVCCScanner hooks we could imagine an integrated scan&delete rather than the separate steps. We'd still need to buffer the deleted keys, but the would be buffered only once in the batch.

Jira issue: CRDB-3876

@petermattis petermattis added C-performance Perf of queries or internals. Solution not expected to change functional behavior. A-storage Relating to our storage engine (Pebble) on-disk storage. labels Aug 24, 2020
@petermattis petermattis added this to Incoming in Storage via automation Aug 24, 2020
@jlinder jlinder added the T-storage Storage Team label Jun 16, 2021
@jbowens jbowens moved this from Incoming to Backlog in Storage Aug 15, 2022
@github-actions
Copy link

github-actions bot commented Sep 7, 2023

We have marked this issue as stale because it has been inactive for
18 months. If this issue is still relevant, removing the stale label
or adding a comment will keep it active. Otherwise, we'll close it in
10 days to keep the issue queue tidy. Thank you for your contribution
to CockroachDB!

@petermattis
Copy link
Collaborator Author

I'm pretty sure this issue remains valid. Someone from @cockroachdb/storage should triage and decide if this optimization is worthwhile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-storage Relating to our storage engine (Pebble) on-disk storage. C-performance Perf of queries or internals. Solution not expected to change functional behavior. T-storage Storage Team
Projects
Status: Backlog
Storage
  
Backlog
Development

No branches or pull requests

3 participants