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

execution: initialize next in aggregation even if we aggregate the labels away #504

Conversation

MichaHoffmann
Copy link
Contributor

In aggregations where we aggregate all labels away ( like sum(X) ) we are lazily initializing the "next" vector operator. This leads to us not parallelizing initialization if we are executing queries like sum by (foo) (X) / on () group_left () sum(X). If initialization is expensive, for example in distributed engine; this double query latency.

@MichaHoffmann MichaHoffmann force-pushed the mhoffmann/initialize-next-even-if-we-aggregate-its-labels-away branch from d0576aa to 2ac60cf Compare January 3, 2025 13:00
@MichaHoffmann
Copy link
Contributor Author

Traces show that some binary expressions execute each of their arms sequentially instead of parallel, traced it to this missing initialization:
image

Copy link
Collaborator

@fpetkovski fpetkovski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, not an easy thing to catch!

execution/aggregate/hashaggregate.go Outdated Show resolved Hide resolved
Co-authored-by: Filip Petkovski <[email protected]>
Signed-off-by: Michael Hoffmann <[email protected]>
@MichaHoffmann MichaHoffmann merged commit 41d0d9f into main Jan 3, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants