# Open Beta: Aggregate Awareness (with PreAggregate)

**URL:** <https://community.holistics.io/t/open-beta-aggregate-awareness-with-preaggregate/1944>\
**Category:** Product Releases\
**Created:** [May 21, 2024, 5:26am UTC](https://community.holistics.io/t/open-beta-aggregate-awareness-with-preaggregate/1944 "2024-05-21T05:26:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![datbth](https://community.holistics.io/user_avatar/community.holistics.io/datbth/32/1414_2.png) [@datbth](https://community.holistics.io/u/datbth)\
**Post date:** [May 21, 2024, 5:26am UTC](https://community.holistics.io/t/open-beta-aggregate-awareness-with-preaggregate/1944/1 "2024-05-21T05:26:03Z")

</div>

Hi all,

In this post, we would like to proudly introduce our _upcoming_ feature: [**Aggregate Awareness**](https://docs.holistics.io/as-code/aggregate-awareness).

## Background

Imagine you have a fact table called `orders` that contains data of every order made on your e-commerce platform. Throughout your 5 years in business, the table `orders` has accumulated **billions of rows**.

Now, in order to answer questions like “Total number of items ordered in each year”, the database has to crunch through those billions of rows and _aggregate_ the total. This process may take **several minutes** to complete and consume **lots of database resources** (typically memory and CPU)!  
On the other hand, towards business users, this is a very simple question. In their eyes, they just need 5 numbers, 1 for each year. “Why does it take so long to get 5 numbers?!”

In data engineering and analytics, “pre-aggregation” is a well-known tool/technique to serve data questions like this faster.  
Essentially, the data engineer can “pre-aggregate” the `orders` table into `total_quantity_by_month` or `total_quantity_by_year`. Such “pre-aggregation” is done ahead of the business users’ usage, so that when the business users actually ask the question, the system can just process `total_quantity_by_month` (~ 60 rows) or `total_quantity_by_year` (~5 rows) and pull out the answer immediately!

### Challenges

In the context of self-serve analytics where the business users use the Business Intelligence platform themselves to “query” or “explore” the data, it is actually quite challenging to **make sure those users are correctly using the pre-aggregated tables** like `total_quantity_by_month` or `total_quantity_by_year` _instead of_ `orders`. This raises the need for the BI platform to be “aggregation-aware” and be able to _automatically_ use the appropriate pre-aggregates for the business users.

Additionally, it requires **significant effort and skills** for the data engineers to **maintain the pre-aggregates** , keeping them **accurate** and **up-to-date**.

## Aggregate Awareness 🎉

To solve the above challenges, Holistics is developing **Aggregate Awareness** that consists of these sets of features:

- 🤖 **Aggregate Awareness** : automatically **identify** eligible pre-aggregates and **substitute** them into queries, making the queries use _smaller_ pre-aggregated tables while still producing _accurate_ results.
- ✍ **Pre-Aggregate Definition** : allow analytic engineers to _conveniently_ **define** the pre-aggregates
- 📦 **Pre-Aggregate Persistence** : allow analytic engineers to _conveniently_ and _accurately_ **persist/materialize** the pre-aggregates
- 💡 **Pre-Aggregate Suggestions (later)**: automatically **suggest relevant pre-aggregates** to speed up your explorations and reports.

> **Please take a _first look_ at the usage of Aggregate Awareness via this tutorial** : [Using Aggregate Awareness | Holistics Docs (4.0)](https://docs.holistics.io/tutorials/using-aggregate-awareness).

Here are some snippets taken from the above tutorial:

```jsx
pre_aggregate aggregated_quantity_by_month {
  dimension pa_created_at {
    for: ref('demo_orders', 'created_at')
    time_granularity: 'month'
  }
  measure pa_sum_quantity {
    for: ref('demo_order_items', 'quantity')
    aggregation_type: 'sum'
  }
  persistence: FullPersistence {
    schema: 'persisted'
  }
}

```

 ![](https://community.holistics.io/uploads/default/original/2X/6/68ee921b6531d054231a588296867023d359001a.png)

 ![](https://community.holistics.io/uploads/default/original/2X/5/524878edc9fa07f4b9d0db1114208aa694474c8e.png)

![](https://community.holistics.io/uploads/default/original/2X/f/fbed05bbde4d255404b678034cbad39fde6d11ca.gif)

## Closing Notes

We believe Aggregate Awareness will unlock analytics engineers and allow them to answer data questions much more efficiently and much faster, ultimately delivering better experience to end users.

To receive updates (or even Beta version) early, please fill in this [Early Interest Form](https://form.jotform.com/230511857392457/prefill/664c2fcc633961c7bed679d6969e).  
Kindly note that Aggregate Awareness will only be available in [Datasets that use AQL engine](https://docs.holistics.io/as-code/amql/enabling-aql).

If you have any questions, feel free to let us know! ❤

p/s the above tutorial page and its screenshots are all taken from a _functional_ version in our development environment. So you can expect this to be released soon! 😉

---

<div class="post-metadata">

**Author:** ![datbth](https://community.holistics.io/user_avatar/community.holistics.io/datbth/32/1414_2.png) [@datbth](https://community.holistics.io/u/datbth)\
**Post date:** [May 28, 2024, 9:19am UTC](https://community.holistics.io/t/open-beta-aggregate-awareness-with-preaggregate/1944/2 "2024-05-28T09:19:09Z")

</div>

Here is our new Demo video!

- 0:00 - 0:10: Without Aggregate Awareness
- 0:10 - 0:32: Setting up and using Aggregate Awareness via `PreAggregate`

---

<div class="post-metadata">

**Author:** ![tridvm](https://community.holistics.io/user_avatar/community.holistics.io/tridvm/32/1719_2.png) [@tridvm](https://community.holistics.io/u/tridvm)\
**Post date:** [July 18, 2024, 3:35am UTC](https://community.holistics.io/t/open-beta-aggregate-awareness-with-preaggregate/1944/3 "2024-07-18T03:35:42Z")

</div>

Hi folks 👋  
I have a new update ☄

Aggregate Awareness finally opens requests for Closed Beta users. You can [**Request Beta Access**](https://form.jotform.com/230511857392457/prefill/664c2fcc633961c7bed679d6969e) and try it out.

Aggregate Awareness helps you utilize summarized data (transformed by tools such as dbt, Airflow, BI like Holistics, etc.) to dynamically answer data questions with just enough information. This enhances performance and reduces query costs, avoiding the need to always query the raw tables.

This feature has impacts on everyone in the team:

- Analysts can maintain the pre-aggregates better with less effort (improved process).
- Business users will get the same insights faster by pre-aggregated tables instead of raw data (improved timeliness).

You can learn more about the feature in the official [Public Doc | Aggregate Awareness](https://docs.holistics.io/as-code/aggregate-awareness).

Cheers! 🍻

---

<div class="post-metadata">

**Author:** ![datbth](https://community.holistics.io/user_avatar/community.holistics.io/datbth/32/1414_2.png) [@datbth](https://community.holistics.io/u/datbth)\
**Post date:** [October 28, 2024, 3:45am UTC](https://community.holistics.io/t/open-beta-aggregate-awareness-with-preaggregate/1944/4 "2024-10-28T03:45:00Z")

</div>

**Update** : Aggregate Awareness is now in Open Beta and is available in all Holistics workspaces.
