Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datastore: DomainGetAsOfQuery #2680

Merged
merged 9 commits into from
Jan 30, 2025
Merged

datastore: DomainGetAsOfQuery #2680

merged 9 commits into from
Jan 30, 2025

Conversation

battlmonstr
Copy link
Contributor

No description provided.

@battlmonstr battlmonstr added the erigon3 Erigon3 feature label Jan 27, 2025
@battlmonstr battlmonstr changed the title datastore: HistoryGetQuery datastore: DomainGetAsOfQuery Jan 28, 2025
@battlmonstr battlmonstr force-pushed the pr/history_get branch 2 times, most recently from 99f9c30 to 0dfa5fc Compare January 29, 2025 10:45
@battlmonstr battlmonstr marked this pull request as ready for review January 29, 2025 10:46
@battlmonstr battlmonstr requested a review from canepat January 29, 2025 10:46
@battlmonstr battlmonstr enabled auto-merge (squash) January 29, 2025 10:47
return value;
}

std::optional<std::pair<size_t, uint64_t>> EliasFanoList32::seek([[maybe_unused]] uint64_t v, bool reverse) const {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[[maybe_unused]] is probably a leftover here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, forgot to remove

kvdb::EncoderConcept TKeyEncoder1, snapshots::EncoderConcept TKeyEncoder2,
kvdb::DecoderConcept TValueDecoder1, snapshots::DecoderConcept TValueDecoder2,
const snapshots::SegmentAndAccessorIndexNames* segment_names>
struct HistoryGetQuery {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HistorySeekQuery would be a better name for both capturing the semantics and keeping consistency wrt Erigon.

Copy link
Contributor Author

@battlmonstr battlmonstr Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the desire to align with Erigon. I've called it Get on purpose, because I think Erigon's naming of this API is inconsistent wrt mdbx seek operation and should be renamed to Get. In my mind the difference is that Get (if it succeeds) returns an exact value matching the query parameters (so the query is like: SELECT * WHERE A = 123 LIMIT 1), but Seek can return something that is not an exact match (so the query is like: SELECT * WHERE A >= 123 LIMIT 1). We also call it lower_bound in some places. Additionally, in my mind Seek should reposition a cursor/iterator to be able to continue iteration from that point on (like fseek). I consider HistoryGetQuery as a close friend of DomainPut/Get.

@battlmonstr battlmonstr merged commit 9a04317 into master Jan 30, 2025
5 checks passed
@battlmonstr battlmonstr deleted the pr/history_get branch January 30, 2025 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
erigon3 Erigon3 feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants