Bird
0
0

You have 5 models with these dependencies:

hard🚀 Application Q15 of 15
dbt - Performance Optimization
You have 5 models with these dependencies:
model_1 (no dependencies)
model_2 (depends on model_1)
model_3 (depends on model_1)
model_4 (depends on model_2)
model_5 (depends on model_3)

If you run dbt run --threads 3, what is the minimum number of sequential steps dbt needs to complete all models?
A3
B4
C5
D2
Step-by-Step Solution
Solution:
  1. Step 1: Identify dependency layers

    Layer 1: model_1 (no dependencies)
    Layer 2: model_2 and model_3 (depend on model_1)
    Layer 3: model_4 (depends on model_2) and model_5 (depends on model_3)
  2. Step 2: Calculate steps with 3 threads

    Step 1: Run model_1 alone
    Step 2: Run model_2 and model_3 in parallel (2 threads used)
    Step 3: Run model_4 and model_5 in parallel (2 threads used)
  3. Final Answer:

    3 -> Option A
  4. Quick Check:

    Dependency layers = 3 steps [OK]
Quick Trick: Count dependency layers, parallelize within each layer [OK]
Common Mistakes:
MISTAKES
  • Counting each model as separate step ignoring parallelism
  • Ignoring dependency order
  • Assuming all models run in one step

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes