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

Multi-Level Aggregation in QB #6697

Open
srikanthccv opened this issue Dec 22, 2024 · 0 comments
Open

Multi-Level Aggregation in QB #6697

srikanthccv opened this issue Dec 22, 2024 · 0 comments

Comments

@srikanthccv
Copy link
Member

This feature introduces a "secondary aggregation" capability that allows performing calculations on already aggregated data. Currently, users can only apply one level of aggregation in a query, but there are scenarios that require processing data in multiple stages.

Examples

Database Performance Analysis

Imagine tracking database query performance across multiple users. You might want to:

  1. First find the maximum memory usage per user in each time interval
  2. Then sum these maximums across all users

The SQL equivalent would be:

SELECT SUM(max_memory_usage) 
FROM (
    SELECT MAX(db.query.memory_usage) 
    FROM logs/traces
    GROUP BY db.query.user, interval
) 
GROUP BY interval

Infrastructure Monitoring

Consider monitoring CPU usage across a fleet of servers. You might want to:

  1. First calculate the average CPU usage for each host
  2. Then count how many hosts have an average above 50%

This type of analysis requires two distinct aggregation steps:

  • Primary aggregation: Calculate average CPU per host
  • Secondary aggregation: Count hosts meeting the threshold

This enhancement would enable these more sophisticated analytical queries that weren't possible with single-level aggregation.

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

No branches or pull requests

1 participant