Stay organized with collections
Save and categorize content based on your preferences.
Manage materialized view recommendations
This document describes how the materialized view recommender works,
and also shows you how to view and apply any materialized view recommendations.
Introduction
The BigQuery materialized view recommender can help you improve
workload performance and save workload execution cost. These recommendations are
based on historical query execution characteristics from the past 30 days.
Materialized views are precomputed
views that periodically cache the results of a query for increased performance
and efficiency. Materialized views use smart tuning
to transparently
rewrite queries against source tables to use existing materialized views for
better performance and efficiency.
How the recommender works
The recommender generates recommendations daily for each project that executes
query jobs in BigQuery. Recommendations are based on the analysis
of the workload execution over the past 30 days. The materialized view
recommender looks for repetitive query patterns and computes any savings that
could be made if the repetitive subquery could be moved to an incremental
materialized view. The recommender takes into account any savings at query time
and account maintenance cost for the materialized view. If these combined
factors show a significant positive outcome, then the recommender makes a
recommendation.
This query example shows information about the top supplier. The query contains
a common table expression (CTE) named revenue which represents the total
revenue per every supplier (l_suppkey). revenue is joined with the supplier
table on the condition that the supplier's total_revenue matches
max(total_revenue) across all suppliers. As a result, the query computes
information (l_suppkey, s_name, s_address, s_phone, total_revenue)
about the supplier with the maximum total revenue.
The whole query itself is too complicated to be put into an incremental
materialized view. However, the supplier CTE is an aggregation over a single
table — a query pattern which is supported by incremental materialized
views. The supplier CTE is also the most computationally expensive part of the
query. Therefore, if the example query was run repeatedly over constantly
changing source tables, then the materialized view recommender might suggest
putting the supplier CTE into a materialized view. The materialized view
recommendation for the preceding sample query might look similar to the
following:
The Recommender API also returns query execution information in the form of
insights.
Insights are findings that help you
understand your project's workload, providing more context on how a materialized
view recommendation might improve workload costs.
This predefined role contains
the permissions required to access materialized view recommendations. To see the exact permissions that are
required, expand the Required permissions section:
Required permissions
The following permissions are required to access materialized view recommendations:
For more information about IAM roles and permissions in
BigQuery, see
Introduction to IAM.
View materialized view recommendations
This section describes how to view materialized view recommendations and
insights using the Google Cloud console, the Google Cloud CLI or the Recommender API.
Select one of the following options:
Console
In the Google Cloud console, go to the BigQuery page.
The BigQuery Recommendations pane opens. Under Optimize BigQuery workload cost,
click View details.
A recommendation list appears, showing all recommendations generated for
the current project. To see more information about a specific materialized
view recommendation or table insight, click Details.
Alternatively, you can view all recommendations available for your project
or organization by clicking Recommendations in the navigation menu.
To view materialized view recommendations for a specific project,
use the REST API. With each command, you must provide an authentication
token, which you can get using the gcloud CLI. For more
information about getting an authentication token, see
Methods for getting an ID token.
You can use the curl list request to view all recommendations for a
specific project:
You can also view your recommendations and insights using INFORMATION_SCHEMA
views. For example, you can use the INFORMATION_SCHEMA.RECOMMENDATIONS view to
view your top three recommendations based on slots savings, as seen in the
following example:
You can apply a recommendation to create a materialized view by executing the
suggested CREATE MATERIALIZED VIEW type DDL statement in the Google Cloud console.
In the Google Cloud console, go to the BigQuery page.
The BigQuery Recommendations pane opens. Under Optimize BigQuery workload cost,
click View details.
A recommendation list appears, showing all recommendations generated for
the current project or organization, depending on the selected scope. Locate a
materialized view recommendation and click Details.
Click View in BigQuery Studio. A SQL editor opens containing a
CREATE MATERIALIZED VIEW DDL statement.
In the provided CREATE MATERIALIZED VIEW statement, modify the
MATERIALIZED_VIEW placeholder with a unique materialized view name.
Run the CREATE MATERIALIZED VIEW DDL statement to create a recommended
materialized view.
Troubleshoot recommendation issues
Issue: No recommendations appear for a specific table.
Materialized view recommendations might not appear under the following
circumstances:
There aren't any recurring query patterns found among query jobs executed by a
project.
Potential materialized view would have a high maintenance cost. For example,
source tables are often modified by data manipulation language (DML)
operations, and therefore a materialized view would undergo full refresh,
incurring further costs.
There is an insufficient number of queries that have a common recurring
pattern.
The estimated monthly savings is too insignificant (less than 1 slot).
Query jobs executed by the project already use materialized views.
Pricing
There is no cost or adverse impact on workload performance when you view
recommendations.
When you apply recommendations by creating materialized views, you can incur
storage, maintenance, and querying costs. For more information, see Materialized Views Pricing.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-07-17 UTC."],[],[]]