مشاركة عبر


EXPLAIN CREATE MATERIALIZED VIEW

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime

Important

This feature is in Beta. Workspace admins can control access to this feature from the Previews page. See Manage Azure Databricks previews.

Provides information about whether a query can be incrementalized when being refreshed for a materialized view.

To learn about materialized view incrementalization, see Incremental refresh for materialized views.

Important

EXPLAIN CREATE MATERIALIZED VIEW confirms structural eligibility for incrementalization. It does not guarantee an incremental refresh will be executed when using the AUTO policy. In that mode, the cost model still chooses a full recompute at runtime if factors like changeset size make a full refresh cheaper. The REFRESH POLICY INCREMENTAL and REFRESH POLICY INCREMENTAL STRICT policies override this cost model decision.

Syntax

EXPLAIN [CREATE MATERIALIZED VIEW query]

Parameters

  • query

    A SQL query that creates a materialized view. Any query that creates a materialized view can be used, by prepending EXPLAIN to the query.

    Note

    CREATE MATERIALIZED VIEW queries from Lakeflow Spark Declarative Pipelines may not work with EXPLAIN without update. For example:

    • Expectations (CONSTRAINT...EXPECT clauses) must be removed from the query.
    • Source datasets may need to be qualified with a catalog, schema, or other path that is not needed when run in the context of a pipeline.

Examples

EXPLAIN CREATE MATERIALIZED VIEW foo
AS
select k, sum(v) from source.src_schema.table group by k;
== Incremental Update Eligibility ==
The Materialized View can be incrementally refreshed.

== Detailed Incrementalization Info ==
No issues detected.

== Physical Plan ==
...