-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Apply TSDB jump table and offset construction optimizations to binary doc values #127278
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
Apply TSDB jump table and offset construction optimizations to binary doc values #127278
Conversation
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
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.
LGTM 👍
meta.writeLong(offset); // docsWithFieldOffset | ||
final short jumpTableEntryCount; | ||
if (disiAccumulator != null) { | ||
jumpTableEntryCount = disiAccumulator.build(data); |
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 at the place disiAccumulator
should always be not null? (if numDocsWithField
is not -1 or equal to max doc and valueProducer support optimized merge)
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.
True, I'll remove the check
@@ -152,6 +153,102 @@ public long longValue() throws IOException { | |||
}; | |||
} | |||
|
|||
/** Tracks state of one binary sub-reader that we are merging */ | |||
private static class BinaryDocValuesSub extends DocIDMerger.Sub { |
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.
This is copied from Lucene's DocValuesConsumer
?
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.
Yes, except that it returns an anonymous subclass of TsdbDocValuesProducer
instead of EmptyDocValuesProducer
so that it can support merge stats.
} | ||
|
||
d.add(new BinaryDocValuesField("bytes_1", new BytesRef(tags[i % tags.length]))); |
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.
maybe rename bytes_1
to tags_as_bytes
?
💚 Backport successful
|
Applies the merge optimizations from #126499 and #126732 to binary field types for the ES819 codec.
Relates to #126111