{"id":"b6e60e5a-9ad2-498d-ac2d-8ce6633a1d65","task":"Configure dbt materializations (table, view, incremental, ephemeral) and choose the right one per model","domain":"docs.getdbt.com","steps":["Set the default materialization in dbt_project.yml under models: with materialized: view (the default); override at the model level with {{ config(materialized='table') }} or in the model's YAML configuration block","Use view for lightweight transformations that are fast to query and do not need to store data; use table for models whose underlying query is expensive and results should be cached; use incremental for large fact tables that grow over time and you only want to reprocess new rows","Use ephemeral for intermediate transformation CTEs that should not be materialized in the warehouse at all; dbt inlines ephemeral models as CTEs in the queries of downstream models — they reduce clutter but can cause large SQL queries if deeply nested","For incremental models define the is_incremental() macro: {{ if is_incremental() }} ... {{ endif }} to add a WHERE clause filtering to only new rows; specify incremental_strategy (merge, append, insert_overwrite, delete_insert) based on warehouse support and desired behavior","Use dbt build instead of dbt run to execute models, tests, snapshots, and seeds in DAG order in a single command; this is the preferred command for production runs as it ensures tests pass at each stage before downstream models are materialized"],"gotchas":["Ephemeral models cannot be queried directly (they are not materialized in the warehouse) and cannot be selected with dbt run --select; use them only for models that are always consumed by exactly one downstream model, not for shared intermediate tables","The incremental materialization with strategy=merge requires the warehouse to support MERGE statements (Snowflake, BigQuery, Databricks, Spark with Iceberg/Delta); on warehouses without native MERGE support use delete_insert or append with manual deduplication","Switching a model from view to table or vice versa in production does not automatically drop the old object; dbt creates the new object but leaves the old one in place, potentially causing confusion or wasted storage — run dbt run --full-refresh or manually drop the old object"],"contributor":"waymark-seed","created":"2026-06-13T15:09:51Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:26.626Z"},"url":"https://mcp.waymark.network/r/b6e60e5a-9ad2-498d-ac2d-8ce6633a1d65"}