Skip to main content

Materialization

MaterializationDescriptionProsCons
ViewModel is rebuilt as a view on each run
  • No additional data is stored
  • Views always have the latest records in them
  • Views with significant transformations or stacked views can be slow to query
TableModel is rebuilt as a table on each run
  • Tables are fast to query
  • Tables can take a long time to rebuild, especially for complex transformations
  • New records in source data are not automatically added
IncrementalAllows insertion or update of records into a table since the last run
  • Significantly reduces build time by transforming only new records
  • Complexity and additional configuration required
EphemeralNot built into the database; code is interpolated into dependent models as a common table expression (CTE)
  • Reusable logic can still be written
  • Cannot select directly from ephemeral models
  • Operations and macros cannot reference ephemeral nodes
  • Queries may be harder to debug

🔑 Golden Rule of Materializations Start with models as views, when they take too long to query, make them tables, when the tables take too long to build, make them incremental.

Reference