The Core Difference
Both Dynamic Tables and Materialized Views pre-compute query results for performance. The critical difference is who controls refresh:
| Feature | Dynamic Tables | Materialized Views |
|---|---|---|
| Refresh control | You set a target lag | Snowflake decides (continuous) |
| Freshness | Configurable (minutes → days) | Near-real-time |
| Complexity | Handles multi-table joins, subqueries, Python UDFs | Single-table aggregations only |
| Cost | Warehouse credits on refresh | Automatic, background compute |
| Chaining | Yes — DT can build on other DTs | No |
When to Use Dynamic Tables
Use Dynamic Tables when you need:
- Complex transformations — multi-table joins, window functions, Python UDFs
- Controlled freshness — e.g., reporting layer refreshed every 30 minutes
- Pipeline chaining — building a bronze → silver → gold layer entirely in SQL
CREATE OR REPLACE DYNAMIC TABLE silver.orders_enriched
TARGET_LAG = '15 minutes'
WAREHOUSE = TRANSFORM_WH
AS
SELECT
o.order_id,
o.amount,
c.name AS customer_name,
c.region AS customer_region,
p.name AS product_name
FROM raw.orders o
JOIN raw.customers c ON o.customer_id = c.id
JOIN raw.products p ON o.product_id = p.id;
When to Use Materialized Views
Use Materialized Views when you need:
- Near-zero latency — results updated within seconds of source changes
- Simple aggregations —
COUNT,SUM,AVGon a single table - Query acceleration — MV auto-rewrites matching queries without any code change
CREATE OR REPLACE MATERIALIZED VIEW mv_daily_revenue AS
SELECT
DATE_TRUNC('day', order_date) AS order_day,
SUM(amount) AS total_revenue,
COUNT(*) AS order_count
FROM raw.orders
GROUP BY 1;
Decision Framework
Need < 1 min freshness?
YES → Materialized View (if simple agg) or Dynamic Table with lag='1 minute'
NO → Dynamic Table
Need multi-table joins?
YES → Dynamic Table
NO → Either works
Building a medallion architecture?
YES → Dynamic Tables (chain them: bronze → silver → gold)
NO → Either works
Conclusion
Dynamic Tables are the right choice for most modern data engineering workloads — they're more flexible and easier to chain. Materialized Views still shine for near-real-time, simple aggregations where Snowflake's automatic refresh is valuable.