Skip to main content

Command Palette

Search for a command to run...

Materialized Views in Dashboards for Faster Insights

Updated
11 min read
Materialized Views in Dashboards for Faster Insights
B

Bold BI® empowers businesses to embed interactive dashboards, explore AI-powered analytics, and turn data into actionable insights—all within your apps.

TL;DR: Materialized views store precomputed query results so dashboards can query aggregated data instead of re-running expensive joins and calculations, reducing load times and improving responsiveness for BI workloads.

Introduction

Modern BI dashboards are interactive, filters, drill-down/drill-up, date ranges, and multiple visualizations on a single dashboard can all trigger database queries. Each interaction can trigger expensive database queries involving joins, aggregations, and large scans.

As data volume and user concurrency grow, performance issues appear quickly. Organizations often experience dashboard abandonment, timeouts during peak hours, and rising database infrastructure costs. Over time, slow dashboards reduce trust in analytics and delay decision-making.

Materialized views solve this by moving repeated computation out of runtime queries. Instead of recalculating the same metrics repeatedly, materialized views store precomputed results that dashboards can query directly. By shifting heavy computation out of runtime queries, teams can achieve consistently fast BI performance without sacrificing interactivity.

In this blog, we’ll explain what materialized views are, their benefits, when to use them, and how they can improve dashboard performance.

What is a materialized view in a dashboard?

A materialized view is a database object that stores the results of a query on disk (like a table), so reads are faster than recomputing the query each time. Dashboards read from this stored dataset rather than recomputing joins and aggregations on every request.

A standard view stores only the SQL definition and recomputes the results every time it is queried, whereas a materialized view stores both the SQL definition and the computed query results, enabling much faster read performance at the cost of requiring periodic refreshes to keep the data up to date.

For BI dashboards, this matters because workloads are typically read-heavy, repetitive, and focused on the same KPIs across many users.

Next, let’s look at why materialized views matter in dashboards.

Benefits of materialized views in dashboards

Materialized views offer several advantages for dashboard performance, including:

Faster dashboard load times: Since results are precomputed and stored, dashboards avoid executing expensive queries repeatedly, improving user adoption and reducing wait times.  Consistent performance at scale: By reducing the volume of data processed at runtime, materialized views ensure stable query performance even as datasets grow.  Improved responsiveness for interactive analytics: Queries run on pre-aggregated data instead of raw tables, enabling faster filtering, slicing, and drill-down interactions.  Reduced database load: Precomputed results minimize repeated JOIN operations and aggregations, significantly lowering CPU, memory, and I/O usage on the source database.  Precomputed aggregations: Complex calculations such as totals, averages, and groupings are calculated in advance, eliminating on-the-fly aggregation overhead.  Reduced JOIN operations: Materialized views can store results of multi-table joins, preventing repeated execution of costly JOIN queries during dashboard interactions.  Faster dashboard filtering: Since the dataset is already optimized and smaller in size, filter operations execute more quickly, improving interactivity.

These advantages make materialized views a common best practice for performance-critical BI dashboards.

When to use materialized views in dashboards

Materialized views work best when:

Dashboards rely on complex joins across large tables. Metrics involve heavy aggregations (daily, weekly, monthly rollups). The same KPIs are queried by many users. Data updates on a scheduled cadence (hourly or daily). Consistent performance is more important than real-time freshness.

For databases like MySQL, materialized views are often implemented using summary tables and scheduled refresh logic. Learn more in our article.

Next, let's look at a practical example of how materialized views can be applied in a real‑time marketing analytics dashboard.

Example: Using a materialized view in a marketing analytics dashboard

The marketing analytics dashboard presents a summarized view of campaign performance using pre‑aggregated data. It includes KPI cards for key metrics such as total visitors, conversion rate, cost per click, average leads, and click‑through rate, along with channel‑wise comparisons, engagement insights, and a monthly summary table by channel and destination. Interactive filters for time periods and sales channels allow users to explore trends without reloading the dashboard.

Without optimization, each visual would require joining raw event data, session logs, attribution records, and revenue tables, making queries increasingly expensive as data volume grows.

To improve performance, teams commonly materialize daily or monthly metrics by channel and time period, along with precomputed engagement and conversion measures. By querying these summarized datasets instead of raw tables, Bold BI dashboards load faster and remain responsive, even with multiple visuals and filters.

Applying materialized views in a marketing analytics dashboard

To quantify the impact of materialized views, we tested a marketing analytics dashboard using a dataset containing 50 million records. The results below compare widget query execution times when using raw data versus materialized views. In most tested widgets, materialized views reduced query execution times from seconds to sub-second performance in most widgets, significantly improving dashboard responsiveness and user experience.

Widget Name Design Mode using Raw Data Design Mode using Materialized Views
Select Period (Combo box) 00:00:09.018 00:00:00.001
Select Channel (Combo box) 00:00:03.246 00:00:00.001
Revenue vs Expenses (KPI Card) 00:00:01.326 00:00:00.001
Conversion Rate (Number Card) 00:00:04.195 00:00:00.001
Cost Per Click (Number Card) 00:00:03.196 00:00:00.001
Total Visitors (Number Card) 00:00:01.212 00:00:00.001
Total Sessions (Number Card) 00:00:01.907 00:00:00.005
Average Leads (Number Card) 00:00:01.873 00:00:00.002
Average Click Through Rate (Number Card) 00:00:03.729 00:00:00.001
Avg. Revenue Per Visitor Channel-wise (Chart) 00:00:04.212 00:00:00.003
Average Session Duration (Heat Map) 00:00:05.144 00:00:00.001
Top 5 Channels Based on Engagement Rate (Proportion Chart) 00:00:30.908 00:00:00.001
Summary Details (Grid) 00:00:21.081 00:00:00.011

The results demonstrate how materialized views can dramatically reduce query execution times for dashboard widgets that rely on filters, KPIs, and aggregated metrics. As dataset sizes increase, these optimizations become even more important for maintaining a responsive analytics experience.

Syntax for creating a materialized view In Bold BI

Materialized views are created using the CREATE MATERIALIZED VIEW statement. They store the physical results of a query, typically aggregations or joins used for performance metrics, so dashboards can access data faster without recalculating complex queries each time.

Below are examples of how materialized views are created across commonly used databases.

Syntax for creating an indexed view in SQL Server

In SQL Server, SQL Server does not provide native materialized views. Similar functionality is achieved through indexed views. These views store precomputed metrics such as revenue and expenses, enabling faster dashboard queries when accessed by BI tools.

CREATE VIEW dbo.customer_order_totals WITH SCHEMABINDING AS SELECT   CustomerID,   SUM(OrderAmount) AS total_order_amount,   COUNT_BIG(*) AS order_count FROM dbo.Orders GROUP BY CustomerID; GO

CREATE UNIQUE CLUSTERED INDEX IX_customer_order_totals ON dbo.customer_order_totals (CustomerID);

Once a clustered index is created on this view, the data will be materialized and optimized for performance.

Syntax for creating a materialized view in PostgreSQL

In PostgreSQL, materialized views store precomputed query results that can be refreshed on demand or on a schedule.

This approach is ideal for dashboards that rely on aggregated metrics and require fast query execution.

-- Create a materialized view that joins employees and departments CREATE MATERIALIZED VIEW employee_department_info AS SELECT   e.employee_id,   e.first_name,   e.last_name,   d.department_name FROM emp e JOIN departments d   ON e.department_id = d.department_id;

-- Refresh to populate/update the stored results REFRESH MATERIALIZED VIEW employee_department_info; Syntax for creating a materialized view in Oracle

In Oracle, a materialized view is created using the CREATE MATERIALIZED VIEW statement along with options that define how the data is built and refreshed.

The example below precomputes employee-related metrics such as salary, department, and job details, enabling faster retrieval for reporting and dashboard analysis without querying the base table repeatedly.

CREATE MATERIALIZED VIEW "MATERIALVIEWSAMPLE" AS SELECT "EMPLOYEES_V"."JOB" AS "JOB", "EMPLOYEES_V"."MANAGER_ID" AS "MANAGER_ID", "EMPLOYEES_V"."COMMISSION" AS "COMMISSION", "EMPLOYEES_V"."EMPLOYEE_NAME" AS "EMPLOYEE_NAME", CAST("EMPLOYEES_V"."HIREDATE" AS DATE) AS "HIREDATE", "EMPLOYEES_V"."SALARY" AS "SALARY", "EMPLOYEES_V"."DEPARTMENT_ID" AS "DEPARTMENT_ID", "EMPLOYEES_V"."EMPLOYEE_ID" AS "EMPLOYEE_ID" FROM "SYSTEM"."EMPLOYEES_V" "EMPLOYEES_V"; -- Optional: Create a unique index on the materialized view to improve refresh performance CREATE UNIQUE INDEX "MV_EMPLOYEES_ID" ON "MATERIALVIEWSAMPLE"("EMPLOYEE_ID"); -- Optional: Create a materialized view log for fast refresh CREATE MATERIALIZED VIEW LOG ON "EMPLOYEES_V" WITH ROWID, SEQUENCE ("EMPLOYEE_ID", "HIREDATE", "SALARY", "DEPARTMENT_ID") INCLUDING NEW VALUES; ** -- Optional: Schedule a refresh for the materialized view (you can adjust the refresh options as needed) EXEC DBMS_MVIEW.REFRESH('MATERIALVIEWSAMPLE', 'C', '', TRUE, FALSE, 0); ** -- Optional: Grant necessary privileges to users or roles GRANT SELECT ON "MATERIALVIEWSAMPLE" TO YOUR_USER_OR_ROLE; Syntax for creating a materialized view in Google BigQuery

This example precomputes KPI-related metrics such as total salary expenditure by aggregating data from the employee_data table, enabling faster retrieval without recalculating the value each time.

CREATE MATERIALIZED VIEW sample.mv_salary_by_department AS SELECT   department_id,   SUM(salary) AS total_salary FROM sample.employee_data GROUP BY department_id; Refreshing a materialized view

Available refresh options vary by database platform. Refresh strategy is the key trade-off when using materialized views, balancing data freshness, performance, and resource utilization to suit different analytical needs. The different refresh options include:

Refresh Type  Description  Best For  Manual  Refresh is triggered explicitly when needed  Small datasets  Scheduled  Refresh runs automatically at defined intervals  BI dashboards  Incremental  Update only new or modified data instead of rebuilding everything  Near real-time analytics  Full Refresh  Recompute the entire dataset from scratch  Historical analytics

To learn how to explore and connect materialized views in Bold BI across MSSQL, PostgreSQL, and Oracle, refer to our KB article.

Performance comparison: Raw tables vs materialized views

By leveraging precomputed and summarized data, organizations can eliminate repetitive query processing and significantly boost overall dashboard performance compared to relying on raw datasets.

Materialized views and aggregated tables both reduce runtime work. The best choice depends on your database features, refresh needs, and how flexible the dashboard queries must be.

Metric  Raw Tables  Materialized Views  Aggregated Tables  Execution Time  Slow (full scan + runtime compute)  Fast (precomputed query results)  Very fast (minimal dataset, pre-aggregated)  Dashboard Load  High latency  Faster loading  Fastest loading  CPU Usage  High (heavy processing required)  Moderate (reduced computation)  Low (minimal processing)  Data Volume Scanned  Very high  Medium  Very low  Concurrent Users  Limited (performance degrades)  Improved handling  Highly scalable  Network Latency  High (large data transfer)  Reduced  Minimal

To learn more about optimizing database performance using these techniques, refer to our detailed KB article.

Improve Dashboard Performance with Materialized Views in Bold BI

Materialized views are a highly effective way to improve dashboard performance for large-scale BI workloads. By storing precomputed query results, they reduce query execution time, minimize database load, and help dashboards remain responsive even as data volumes and user concurrency increase. For organizations that rely on interactive analytics, materialized views provide a practical balance between performance, scalability, and data accessibility.

With Bold BI®, you can leverage materialized views, aggregated tables, and optimized data models to build high-performance dashboards that deliver fast, reliable insights across your organization. Whether you're analyzing marketing performance, operational metrics, financial KPIs, or customer data, Bold BI helps ensure users get the information they need without performance bottlenecks.

Ready to build faster, more responsive dashboards? Start your free Bold BI trial today and discover how optimized data strategies, powerful visualizations, and 140+ data connectors can help you deliver analytics at scale. You can also schedule a personalized demo to see how Bold BI fits your BI and embedded analytics requirements.

Frequently asked questions

1.What is a materialized view?

A materialized view is a database object that stores the result of a query as a physical table. Unlike standard views, it saves precomputed data for faster retrieval.

2. How do materialized views improve dashboard performance in Bold BI?

They improve performance by allowing dashboards to use pre-aggregated data instead of running complex queries repeatedly, resulting in faster load times and reduced database load.

3.When should I use materialized views?

They are best used when working with large datasets, complex queries, or frequently accessed dashboards where performance optimization is needed.

4.How often should materialized views be refreshed?

Refresh frequency depends on your data needs, ranging from real-time or frequent refreshes for dynamic data to daily or periodic refreshes for reporting scenarios.

5.Does Bold BI create materialized views automatically?

No. Materialized views must be created in the database, and Bold BI connects to them as an optimized data source.

6.Can materialized views improve embedded analytics performance?

Yes. They store precomputed results, which helps speed up queries and improves dashboard load times.

7.What databases support materialized views with Bold BI?

Bold BI works with databases such as PostgreSQL, Oracle, SQL Server (indexed views), Redshift, BigQuery, and Snowflake.

8.Are materialized views suitable for real-time dashboards?

Generally not. Because they depend on refresh schedules, materialized views are typically better suited for near-real-time or historical analytics than fully real-time dashboards.

Materialized View in Dashboards for Quick Insights