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

Reduce heap usage in BestBucketsDeferringCollector #105444

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

iverase
Copy link
Contributor

@iverase iverase commented Feb 13, 2024

BestBucketsDeferringCollector delays the creation of sub-aggregations by collecting on the heap the values of documents and buckets received in LeafBucketCollector#collect(int doc, long bucket). Those values are replayed in a later stage if necessary.

We are currently using Lucene PackedLongValues to compress those integers on heap. In #103624 we added PFOR-delta for compression of postings in Elasticsearch which is probably more space efficient that the algorithm in PackedLongValues which is essentially a FOR (without the P) so likely more wasteful.

This PR introduces PForLongValues which follows the PackedLongValues API so it can easily replace the current usage of PackedLongValues in BestBucketsDeferringCollector.

@iverase iverase requested a review from jpountz February 13, 2024 10:43
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Feb 13, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine
Copy link
Collaborator

Hi @iverase, I've created a changelog YAML for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Aggregations Aggregations >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants