storage: reduce heap allocations in MVCCDeleteRange #53315
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
Spun out of #53192.
MVCCDeleteRange
is implemented viaMVCCScan
followed byMVCCDelete
for each of the returned keys. This is inefficient for three reasons. First, we're usingMVCCScan
which returns a[]roachpb.KeyValue
. We could instead useMVCCScanToBytes
. 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 newMVCCScanOption
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 appropriatepebbleMVCCScanner
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
The text was updated successfully, but these errors were encountered: