-
Notifications
You must be signed in to change notification settings - Fork 4.1k
storage: cheaper range key change detection #84379
Copy link
Copy link
Closed
Labels
A-kv-replicationRelating to Raft, consensus, and coordination.Relating to Raft, consensus, and coordination.A-storageRelating to our storage engine (Pebble) on-disk storage.Relating to our storage engine (Pebble) on-disk storage.C-performancePerf of queries or internals. Solution not expected to change functional behavior.Perf of queries or internals. Solution not expected to change functional behavior.T-storageStorage TeamStorage Team
Description
With combined point/range key iteration, we often find ourselves checking for changes to the range key by comparing the bounds to a previous range key, and then caching the range key stack. Something like:
if hasPoint, hasRange := iter.HasPointAndRange(); hasRange {
if rangeBounds := iter.RangeBounds(); !rangeBounds.Key.Equal(rangeStart) {
rangeStart = append(rangeStart[:0], rangeBounds.Key...)
iter.RangeKeys().CloneInfo(&rangeKeys)These constant key comparisons are expensive. Furthermore, it would be nice if it was safe to reuse the range key stack as long as the keys didn't change, so we wouldn't have to clone it.
This depends on cockroachdb/pebble#1775.
Jira issue: CRDB-17624
Epic CRDB-2624
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-kv-replicationRelating to Raft, consensus, and coordination.Relating to Raft, consensus, and coordination.A-storageRelating to our storage engine (Pebble) on-disk storage.Relating to our storage engine (Pebble) on-disk storage.C-performancePerf of queries or internals. Solution not expected to change functional behavior.Perf of queries or internals. Solution not expected to change functional behavior.T-storageStorage TeamStorage Team