Open jpountz opened 2 years ago
Pinging @elastic/es-analytics-geo (Team:Analytics)
We would probably need to figure out dynamic pruning on keyword fields if we want to get benefits on the composite aggregation since it's often used in combination with keyword
fields. I opened LUCENE-10633.
Description
Queries sorted by field have improved a lot over the years when it comes to dynamic pruning:
The
composite
aggregation is very similar to sorted queries, yet it is currently at stage 2 in the evolution of sorted queries with regards to dynamic pruning. Unless you are aggregating on the primary index sort field, computing a single page of data requires collecting all matches that match the query.Can we add dynamic pruning support to the
composite
aggregation so that computing a single page of results wouldn't need to look at all matches? Ideally it would reuse the same logic that we are using for sorting queries via theLeafFieldComparator#competitiveIterator
andLeafCollector#competitiveIterator
APIs.Relates to #85759.