I want to write about how the Model Timing tab helped identify a long running model that was fixed #1802
bennieregenold7
announced in
Archive
Replies: 2 comments 10 replies
-
tagging @dbt-labs/devhub on this idea |
Beta Was this translation helpful? Give feedback.
9 replies
-
I'm just here to say that I'd love to hear any and all insights/lessons learned from building out dbt Labs' internal dbt project. whether as docs, blog posts, or talks. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Core Thesis
Model Timing
to find a model bottleneckSpecific Target Audience
Those that have long running jobs and may not know how to best approach getting the run times down
Supporting Example Use Case
Us!! See the mock intro below for how we addressed
fct_dbt_invocations
Narrative Arc
Sample Intro
The dbt Labs internal project is a beast. Our daily incremental job that runs 4x/day invokes over 1,700 models, and used to run for nearly 3 hours utilizing 8 threads. Sifting through the run to find bottlenecks would be incredibly difficult without the
Model Timing
tab in dbt Cloud. By showing run times in a graphical interface it quickly becomes apparent which models are slowing a run down. Here's a quick example of our incremental job before a fix was applied to our longest running model:As you can see, it's pretty easy to identify the model that's causing the long run times. The model
fct_dbt_invocations
takes, on average, 1.5 hours to run. This isn't completely surprising, it's a relatively large dataset (~5B records) and we're doing some intense calculations within the SQL. However, when it came time to add some new metrics to that model it felt like a golden opportunity to revisit how this is being built.After refactoring this code, we ended up with a new incremental model named
dbt_model_summary
that took the bulk of the processing out of the mainfct_dbt_invocations
model. Instead of recalculating this complex logic every run, we pull only new models, and run that logic on the smaller subset of those records. The combined run time of the newdbt_model_summary
andfct_dbt_invocations
is now ~15-20 minutes, a savings of over an hour per run!Beta Was this translation helpful? Give feedback.
All reactions