Skip to content

storage: require Valid() for HasPointAndRange() in MVCCIterator #83801

@erikgrinaker

Description

@erikgrinaker

Currently, MVCCIterator mandates that HasPointAndRange() must return a consistent value with true. However, this means that pebbleIterator.HasPointAndRange() needs to call through to Valid() to do additional checks (e.g. that we haven't moved into the lock table), but most times the caller has already called Valid(). This additional validation can be expensive, and HasPointAndRange() has been seen to have a non-negligible cost.

We should change the MVCCIterator contract to require Valid() to be called before HasPointAndRange(), to avoid this cost.

Jira issue: CRDB-17273

Epic CRDB-2624

Metadata

Metadata

Assignees

Labels

A-kv-replicationRelating to Raft, consensus, and coordination.A-storageRelating to our storage engine (Pebble) on-disk storage.C-performancePerf of queries or internals. Solution not expected to change functional behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions