Hey I recently noticed that the most expensive job...
# community-support
t
Hey I recently noticed that the most expensive jobs of our BigQuery dbt project is the
dbt_run_results
MERGE statement. Anybody else sharing similar observations? Any recommended workarounds? We already have it running in prod and CI only I guess using the more expensive MERGE statement over more efficient delete+insert in order to ensure that the operation happens in a single run and nothing gets lost I found github.com/elementary-data/elementary/issues/1959 online but it was closed
a
Are you running dbt core 1.x? On fusion, I believe elementary does use an INSERT statement … but also, per my above issue, it hangs indefinitely, so I wouldn’t suggest this workaround 😅
i
Hi @Tim Hiebenthal! We looked into this issue and it does seem we can easily change this model and a few others to be append-only, which should improve performance significantly. Thanks for surfacing. We'll merge a fix shortly and it will be in the upcoming version. As a workaround, I can suggest simply skipping this model in your runs for now:
Copy code
dbt run --exclude dbt_run_results
This is actually fine because run results are inserted via the
on-run-end
hook anyway. The model mainly needs to run on version updates in case there's a schema change to this model.
t
Thanks! will try that out
and yes: dbt-core 1.11 it is i think
i
@Tim Hiebenthal @Alex I believe this should be solved in v0.26.0 that was released last week. In addition to the fix mentioned above there was a fix related to the Fusion hang.
🙌 1
a
Based on my prelim testing, this does appear to be fixed!
drop joy 1
Yup, my issue was definitely resolved by some change somewhere! Feel free to close this issue out: github.com/elementary-data/elementary/issues/2318 (Happy to do it myself, but not entirely sure which change to point to in the comment and/or whether you wanna link it to a specific PR or something)
i
Great to hear @Alex Stevens ! I'll close it.