Skip to main content

Aggregate Awareness

Introduction

Querying billions of rows is slow and expensive. Data teams often solve this by building pre-aggregated tables—smaller, summarized versions of raw data. But this creates a new problem: analysts must know which table to query for each question, and picking the wrong one means slow queries or incorrect results.

Aggregate Awareness solves this. You define your pre-aggregated tables once, and Holistics automatically picks the right table for each query—no manual table selection required.

The result:

  • Faster queries (fewer rows scanned)
  • Lower costs (less compute)
  • Same accuracy (automatic table matching)
  • Zero friction for analysts (they query one model, Holistics handles the rest)
Aggregate Awareness - Overview

Key concepts

Before diving deeper, here are the core terms you'll encounter:

TermDefinition
Pre-aggregateAggregation performed before query time, producing a condensed version of source data.
Pre-aggregated tableThe output table from a pre-aggregate process (e.g., daily transaction counts instead of individual transactions).
Aggregate AwarenessThe system's ability to automatically identify and use the right pre-aggregated table for each query.
GranularityThe level of detail in a dataset. Coarse = less detail (e.g., monthly totals). Fine = more detail (e.g., daily totals).

Granularity examples:

  • month has coarser granularity than day
  • (country) has coarser granularity than (country, city)

How it works

Setting up Aggregate Awareness takes two steps:

  1. Define the mapping between your raw model's fields and your pre-aggregated table's columns
  2. Connect the pre-aggregated table (use an existing table or let Holistics create one)

Once configured, Holistics inspects every query and automatically rewrites it to use the smallest table that can answer the question accurately.

How it works - Pre-aggregate

The query rewriting process

When a user queries the transactions model:

  1. Holistics checks which dimensions and measures the query needs
  2. It finds pre-aggregated tables that contain those fields
  3. It selects the smallest qualifying table
  4. It rewrites the query to use that table instead of the raw table
How it works - Query with pre-aggregate

The key insight: Analysts work with one model (transactions). They don't need to know about pre-aggregated tables—Holistics handles the optimization transparently.

When to use Aggregate Awareness

Aggregate Awareness is most valuable when:

  • Your raw tables have millions to billions of rows
  • Users frequently query the same dimensions and measures (e.g., daily sales by region)
  • Query performance or cost is a concern

Common use cases:

  • Daily/weekly/monthly transaction summaries
  • Regional sales rollups
  • User activity aggregations
  • Event counts by time period

Next steps

Ready to set it up? Follow the Quick Start Guide to configure your first pre-aggregate.


Let us know what you think about this document :)