cockroachdb / cockroachdb/cockroach

kv: skip MVCCValueHeader decoding when possible

Open
#131,359 0 comments 0 reactions 0 assignees View on GitHub
branch-master C-bug T-kv
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

**Describe the problem**

Currently, `decodeExtendedMVCCValue` always unmarshals the MVCC Value Header if it finds one. But, most callers do nothing with this header, making this unmarshalling wasted work. Previously, this was likely only a small issue as very few keys are expected to have a value header. But in recent releases IMPORT and LDR are both writing into the value header. As a result, we may see many more keys with value headers.

We should improve our methods here so that callers that don't care about the header can more quickly skip past it rather than unmarshalling it to avoid wasted work.

Jira issue: CRDB-42519

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.