cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
29.98k stars 3.79k forks source link

storage: consider alternative iterator interfaces #91018

Open jbowens opened 1 year ago

jbowens commented 1 year ago

The MVCCIterator interface is used as a one-dimensional iterator over many different entities in various contexts:

I think it would be a worthwhile exercise to define a new interface with a more structured understanding of the various storage-level primitives. My hunch is that a more structured, typed interface would result in more understandable code (both in callers and within the pkg/storage implementation) and possibly be more performant as well by reducing copying and key comparisons.

Some discussion in #90959.

Jira issue: CRDB-21076

jbowens commented 1 year ago

cc @sumeerbhola in case you have thoughts, plus if you think there's something to consider about lazy value fetching here too

github-actions[bot] commented 5 months ago

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!