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
Use segment ordinals as global ordinals if possible #5873
Use segment ordinals as global ordinals if possible #5873
Conversation
…ues for a field on a shard level. Relates to elastic#5854
This looks good. I think we just need to make sure the mapping from segment ords to global ords for these segments isn't loaded into the cache. |
…l maxOrd, and use segment ordinals directly instead
Updated the PR and yes, that make absolutely sense, to save a bit more memory. |
@@ -105,7 +105,7 @@ public InternalGlobalOrdinalsBuilder(Index index, @IndexSettings Settings indexS | |||
breakerService.getBreaker().addWithoutBreaking(memorySizeInBytes); | |||
|
|||
if (logger.isDebugEnabled()) { | |||
String implName = segmentOrdToGlobalOrdLookups[0].getClass().getSimpleName(); | |||
String implName = maxOrd < threshold ? "PackedIntOrdinalMappingSource" : "CompressedOrdinalMappingSource"; |
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.
Can we avoid hard-coding it?
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.
Agreed, this is ugly, I'll make it nice. In the current state segmentOrdToGlobalOrdLookups entries could be null (all of them), so that is why I resorted this hack.
*/ | ||
public void initializeDocCounts(long maxOrd) { | ||
docCounts = bigArrays.grow(docCounts, maxOrd); | ||
} |
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.
Is it necessary? the aggregator factory should create it with the right size directly? (if it does not I think this is a bug)
…rmsAggregator.WithHash impl. Relates #5873
…rmsAggregator.WithHash impl. Relates #5873
Use segment ordinals as global ordinals if a segment contains all values for a field on a shard level.
PR for #5854