Bird
0
0

A dbt model for Snowflake uses this config:

medium📝 Debug Q7 of 15
dbt - Performance Optimization
A dbt model for Snowflake uses this config:
config(
  materialized='incremental',
  cluster_by=['region']
)
But queries on the model are slow. What could be wrong?
AClustering keys should include multiple columns for better performance
BThe clustering keys are not maintained after incremental loads unless manually reclustered
CIncremental models do not support clustering in Snowflake
DThe cluster_by config must be inside the SQL select statement
Step-by-Step Solution
Solution:
  1. Step 1: Understand clustering behavior with incremental models

    Snowflake clustering keys are not automatically maintained after incremental inserts; reclustering is needed.
  2. Step 2: Identify why queries remain slow

    Without reclustering, data is not physically organized, causing slow queries despite cluster_by config.
  3. Final Answer:

    The clustering keys are not maintained after incremental loads unless manually reclustered -> Option B
  4. Quick Check:

    Incremental + clustering needs manual recluster [OK]
Quick Trick: Recluster after incremental loads to maintain clustering [OK]
Common Mistakes:
MISTAKES
  • Assuming clustering auto-maintains on incremental models
  • Thinking cluster_by must have multiple columns
  • Placing cluster_by inside SQL instead of config

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes