Skip to content

Conversation

ajleong623
Copy link
Contributor

@ajleong623 ajleong623 commented Oct 6, 2025

Description

This change enables star tree profiling and also profiles the pre-computation phase when profiling aggregations. Sometimes when getting building leaf collector, the precomputation phase is part of that, therefore, we want to separate the rest of the precomputation phase from the logic in tryPrecomputeAggregationForLeaf.

A change I made was to update ProfilingAggregator.java so that now it can override the logic of tryPrecomputeAggregationForLeaf to account for timing. Additionally, in Aggregator.java, I moved the method of precomputing from the base class to Aggregator so that ProfilingAggregator could override that method.

For collecting the profiling information for the star tree sub-phases, I noticed that all aggregators that use star tree both scan the star tree index to find the matched star tree document ids and add those ids into the buckets. All star tree pre-computation supporting aggregators implement StarTreePreComputeCollector, therefore, I added the methods into that class so that the aggregators could implement them. The reason for this is to separate the logic for scanning the star tree and filling those buckets.

Finally, for collecting the breakdown results, I create a new breakdown StarTreeProfileBreakdown.java which represents a breakdown for the star tree phase. In AggregationProfileBreakdown.java, I added a few methods to detect whether a StarTreeProfileBreakdown has been attached and to also keep track of the breakdown. Each AggregationProfileBreakdown could have at most one StarTreeProfileBreakdown attached to it. Additionally, in InternalAggregationProfileTree.java, I added some logic to add the star tree profiling result as a child to that AggregationProfileBreakdown.

Related Issues

Resolves #19295

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link
Contributor

github-actions bot commented Oct 6, 2025

❌ Gradle check result for 6e2309a: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

…utation in aggregation profiling tree

Signed-off-by: Anthony Leong <[email protected]>
Copy link
Contributor

github-actions bot commented Oct 8, 2025

❌ Gradle check result for a4e1bfd: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement or improvement to existing feature or request Search:Aggregations Search:Relevance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Enhance Profile API to show (star-tree/other) pre-computation time

1 participant