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
Don't use bitset cache for children filters. #10663
Don't use bitset cache for children filters. #10663
Conversation
if (filter == null) { | ||
continue; | ||
} | ||
DocIdSet nestedTypeSet = filter.getDocIdSet(context, context.reader().getLiveDocs()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to pass livedocs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it just felt safe to do this... but I don't we need to, because nested docs can't be modified on their own. Their life cycle depends on the parent doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its a little confusing, since we explicitly didn't pass bits before. IMO we should just have a code comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a comment regarding this.
} | ||
// We can pass down 'null' as acceptedDocs, because nestedDocId is a doc to be fetched and | ||
// therefor is guaranteed to be a live doc. | ||
DocIdSet nestedTypeSet = filter.getDocIdSet(context, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filter.getDocIdSet can return null, can you check that nestedTypeSet is not null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the iterator.
LGTM |
I just left a comment about some missing null checks. |
3687d9b
to
0ad1c12
Compare
Only parent filters should use bitset filter cache, to avoid memory being wasted. Also in case of object fields inline the field name into the nested object, instead of creating an additional (dummy) nested identity. Closes elastic#10662 Closes elastic#10629
79ca16d
to
7a6fe80
Compare
Only parent filters should use bitset filter cache, to avoid memory being wasted.
Closes #10662
Closes #10629