Skip to content

Multi-Level Aggregation in QB #6697

Open
@srikanthccv

Description

@srikanthccv

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions