materialized views Flashcards

(18 cards)

1
Q

… (existing content unchanged) …

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a materialized view in Lakeflow Declarative Pipelines?

A

A materialized view is a cached result of a query that is refreshed on a specified interval and can be queried like a table, providing faster access than standard views.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How does a materialized view stay up to date?

A

It tracks changes in upstream data and incrementally applies transformations on trigger based on a refresh interval, maintaining synchronization with source data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What happens when a materialized view is created outside of a pipeline in Databricks SQL?

A

Databricks creates a hidden pipeline to manage the updates for that materialized view.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How are materialized views stored and managed in Databricks?

A

Metadata is managed by Unity Catalog and cached data is stored in cloud storage. System views support incremental update tracking.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is an example use case for a materialized view in SQL?

A

Joining tables such as partners and sales to create a result table that is automatically kept up-to-date and optimized for query performance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When do materialized views perform full recomputation instead of incremental updates?

A

If input changes are complex or can’t be computed incrementally, the materialized view may be fully recomputed for correctness.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the limitations of materialized views?

A

They may require full recomputation, are not suitable for low-latency use cases, and not all computations support incremental updates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

… (existing content unchanged) …

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is an incremental refresh in the context of materialized views?

A

An incremental refresh processes only the changes in the underlying data since the last refresh, rather than recomputing the entire query result.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

When are materialized views incrementally refreshed in Databricks?

A

When the materialized view is supported by a serverless pipeline and its query supports incrementalization, otherwise a full refresh occurs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a full refresh of a materialized view?

A

A full refresh recomputes the entire result from scratch, reprocessing all source data regardless of whether changes were detected.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How can you force a full refresh in Databricks SQL?

A

Use the SQL command REFRESH MATERIALIZED VIEW mv_name FULL to override the default behavior and trigger a full recomputation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which data sources support incremental refresh of materialized views?

A

Delta tables, materialized views, streaming tables, and targets of AUTO CDC flows support incremental refresh if configured correctly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What table properties enhance incremental refresh performance?

A

Enabling deletion vectors, row tracking, and change data feed on the source table improves incremental refresh capability.

17
Q

What SQL constructs are supported in incrementally refreshed materialized views?

A

Supported constructs include SELECT expressions, GROUP BY, UNION ALL, INNER/OUTER JOINS, WHERE, HAVING, WITH, QUALIFY, and OVER clauses.

18
Q

How can you check which refresh strategy was used in a materialized view update?

A

Query the event_log() function for the materialized view and filter for event_type = 'planning_information'.