-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Proposal for alternate way to traverse BKD tree with prefetching matching leaves for IO concurrency #15376
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
base: main
Are you sure you want to change the base?
Conversation
|
This PR does not have an entry in lucene/CHANGES.txt. Consider adding one. If the PR doesn't need a changelog entry, then add the skip-changelog label to it and you will stop receiving this reminder on future updates to the PR. |
|
I am looking for overall feedback on high level idea for this. I do want to make the api interfaces added/modified more cleaner and possibly minimal. |
|
This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the [email protected] list. Thank you for your contribution! |
|
In general, I am not in favour of adding a new intersects method to the PointValues API like you are doing with |
|
Thanks for the feedback @iverase !! I'll hide prefetching detail into existing intersect api. That would need adding some new methods to existing Visitor. |
As far as we can add some default implementation, we should be ok. |
ffc030a to
2bdef68
Compare
2bdef68 to
a54f8e5
Compare
|
@iverase I removed the new intersect api in PointValues. However I have to create a new visitor PrefetchCapableVisitor because I want to cache the prefetched leaf blocks so that I can visit them after recursion. This is a new abstract class with some state in PointValues.java. Let me know your thoughts on this. |
d0bc069 to
e0f150b
Compare
e0f150b to
2d488aa
Compare
Description
I would appreciate feedback on BKD traversal with prefetching.
At a high level, this is what I am doing:
Start traversing the BKD tree as is,
If cell is inside the query
a) Call goes to prepareDocIDs method variation where if isLeaf is true.
b) Do not read the leaf node yet. Instead, get the leafOrdinal, if this leaf ordinal is in continuation to last matching leaf ordinal (which I am storing in visitor) i.e leafOrdinal == visitor.lastMatchingLeafOrdinal() + 1. Do not call prefetch as this should be hopefully taken care by kernel readaheads. Otherwise if its not a continuous match i.e leafOrdinal != visitor.lastMatchingLeafOrdinal() + 1, then call prefetch on this leaf node file pointer. Also store this leaf node fp in visitor for visting matching doc IDs later.
c) If its not a leafNode continue with recursion as is.
d) Visit the cached leaf node file pointers after recursion.
For remaining traversal code remains unchanged.
Related Issue