Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
dbt Labs · dbt Analytics Engineering

Core Materializations

dbt Analytics Engineering · Lesson 3 of 17 · 15:17

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the dbt Analytics Engineering Certification exam. In this lesson: views and tables, incremental and ephemeral models, materialized views and on_configuration_change, and where to configure a materialization, with the most specific setting winning. Includes three original practice questions, with Orchardline Meal Kits, a fictional meal-kit company, as the example.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

Views on views, and clutter

Orchardline's dashboards query a stack of views built on other views, and the weekly revenue page now takes a minute to load. Meanwhile, a tiny helper model clutters the warehouse, and nobody ever queries it. This lesson covers the five built in materializations, views, tables, incremental models, ephemeral models, and materialized views, and how to choose and configure them.

Views and tables

A materialization decides how dbt persists a model in the warehouse. The view is the default: on every run, dbt recreates it with a create view as statement, so it stores no data, and it always returns the latest records. But views that do heavy transformations, or that stack on other views, are slow to query, so start with views, and change only when you see performance problems. A table is rebuilt on every run with create table as: it is fast to query, but it can take long to rebuild, and it only shows new raw data after the next run. Use tables for models that BI tools query, and for slow transformations that many downstream models reuse.

Incremental and ephemeral

An incremental model is a table that dbt fills only with new or changed records after its first run, which can cut build time a lot. It needs extra configuration, so use it when runs become too slow, not from the start: lessons seven and eight cover it in detail. An ephemeral model is not built in the warehouse at all: dbt interpolates its code into the models that reference it, as a common table expression. That keeps the warehouse clean, but you cannot select from it directly, macros run with dbt run operation cannot reference it, and overusing it makes queries harder to debug. Keep ephemeral models for light transformations early in the DAG, used by one or two models.

Materialized views

A materialized view combines the query speed of a table with the freshness of a view, and the data platform can refresh it on a regular cadence, without a dbt batch run. On a dbt run, it behaves like a code deployment, just as a view does. Its on configuration change setting decides what happens when you change its configuration: apply, the default, changes the object in place, continue leaves it untouched with a warning, and fail stops the run. Not every platform supports it, Snowflake uses dynamic tables instead, so consider it when an incremental model would do, but you want the platform to manage the refresh.

Configuring a materialization

You can set a materialization in three places. In dbt project dot yml, a plus sign before materialized sets it for a whole folder, like every staging model. In a properties YAML file, the config block of one model sets it for that model only. And in the model's SQL file, a config macro at the top sets it too. The most specific setting wins: the config in the SQL file, then the properties file, then the project file, where a subfolder beats its parent folder.

Recap

Let's recap. Views are the default, always current, but slow when heavy or stacked. Tables are fast to query, and rebuilt on every run. Incremental models add only new records, once runs become slow. Ephemeral models become common table expressions, and materialized views let the platform manage the refresh. And the most specific configuration wins: the SQL file, then the properties file, then the project file.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. The revenue dashboard reads a mart built as a view, on top of three other views. Every page load is slow. Data current as of the nightly run is enough. What should change?

    • Materialize the revenue mart as ephemeral
    • Materialize the revenue mart as a table
    • Add more views between staging and the mart
    • Run dbt more often so the views stay current
    Show the answer

    Materialize the revenue mart as a table

    A table stores the result, so the dashboard reads precomputed rows, and the nightly rebuild meets the freshness need. “Materialize the revenue mart as ephemeral” is wrong, since an ephemeral model is not built at all, so the dashboard could not query it. “Add more views between staging and the mart” would only stack more views, which makes queries slower still. And “Run dbt more often so the views stay current” is wrong, since views already return current data, and running dbt more often does not make them faster.

  2. A small model removes test orders, and only one mart uses it. The team wants no extra object in the warehouse, and nobody queries the model directly. Which materialization fits?

    • Table
    • View
    • Incremental
    • Ephemeral
    Show the answer

    Ephemeral

    An ephemeral model is interpolated into the one mart that uses it, as a common table expression, and creates no object in the warehouse. “Table” is wrong, since a table stores a copy of the data, in an object nobody queries. “View” is wrong, since a view is still an object in the warehouse. And “Incremental” is wrong, since an incremental model is a table, with extra configuration this tiny model does not need.

  3. The project file builds every mart as a table, and the marts finance subfolder as incremental. The orders model in that subfolder has {{ config(materialized='view') }}. How does dbt build orders?

    • As a view
    • As an incremental model
    • As a table
    • dbt raises a configuration conflict error
    Show the answer

    As a view

    The config macro in the model's own file is the most specific setting, so it wins over both levels of the project file. “As an incremental model” would hold only without that config macro, since the subfolder beats the marts folder. “As a table” is wrong, since the marts setting is the least specific of the three. And “dbt raises a configuration conflict error” is wrong, since dbt raises no error here, it simply applies the most specific value.