Skip to main content
You can monitor pre-aggregates from Project Settings > Pre-aggregates. This section has two tabs: Materializations for tracking status and Analytics for query hit/miss statistics.

Materialization status

The Materializations tab shows all your pre-aggregates and their current state.
Pre-aggregate materializations list
Each pre-aggregate has a materialization lifecycle: Two columns show how Lightdash refreshes each pre-aggregate:
  • Schedule shows the refresh.cron expression, if the pre-aggregate has one.
  • Triggers shows which triggers rebuild it: on change (dimmed when refresh.on_change is false), schedule when the pre-aggregate has a cron, and manual. Last materialized names the trigger that produced the active materialization. See Scheduling refreshes for how the triggers work.
Click any pre-aggregate to see its full details, including row count, file size, and duration. To refresh every managed pre-aggregate, click Rebuild managed at the top of the page. To refresh one, open its detail drawer and click the rebuild icon next to Last materialization.
Pre-aggregate materialization detail

Hit and miss statistics

The Analytics tab tracks how often queries hit or miss pre-aggregates on a daily basis. Lightdash records these stats automatically for every query it runs, with no setup, and the tab shows the last 3 days. Only queries on explores that have a pre_aggregates block are counted. Queries on other explores don’t appear, not even as misses, so Total Queries can be lower than your project’s overall query volume.
Pre-aggregate analytics
You can break down the statistics by:
  • Explore name — which explores are benefiting from pre-aggregates
  • Query context — whether the query came from a chart, dashboard, or the explorer
  • Chart or dashboard — which specific saved content is hitting or missing
Use these stats to identify opportunities for new pre-aggregates or to tune existing ones.

Why a query misses a pre-aggregate

When a query doesn’t match any pre-aggregate, Lightdash records the specific reason. Understanding these reasons helps you decide whether to adjust your pre-aggregate definition or accept the warehouse query. A query can also match a pre-aggregate and still run on the warehouse, because serving it from the materialization failed. The pre-aggregate icon next to Run query in the Explorer then reads “Pre-aggregate matched (<name>) but failed to serve. Results came from the warehouse”, without the cause. To see the error, turn off execution fallback so the query returns the error instead of running on the warehouse. On a self-hosted instance, the backend logs also record the cause as a warning, Pre-agg execution (duckdb) failed for <query uuid>: <error>. Falling back to warehouse, without turning fallback off. If the error is an S3 access error, check the bucket permissions in the self-hosting troubleshooting.

Dashboard pre-aggregate view

You can also monitor and manage pre-aggregates directly from any dashboard. Open the dashboard menu to access pre-aggregate options.
Pre-aggregate options in the dashboard menu
  1. Pre-aggregation audit — Shows which tiles in the dashboard are hitting or missing pre-aggregates, and why. Available to editors, developers, and admins.
  2. Rebuild pre-aggregates — Triggers a manual re-materialization for the pre-aggregates used by this dashboard. Available to developers and admins only.
Pre-aggregate audit view for a dashboard
The same audit data is available from the terminal via lightdash pre-aggregate-audit, which is useful for scripting, project-wide sweeps, and CI gates.