dbt-labs / dbt-snowflake

dbt-snowflake contains all of the code enabling dbt to work with Snowflake
https://getdbt.com
Apache License 2.0
297 stars 177 forks source link

[Microbatch] Optimizations: use view for temp relation + remove `using` clause during delete statement #1192

Closed MichelleArk closed 2 weeks ago

MichelleArk commented 2 months ago

resolves #1228 docs dbt-labs/docs.getdbt.com/# N/A

Problem

Microbatch performance is underwhelming for dbt-snowflake! A couple underlying reasons: 1) Microbatch largely inherits from delete+insert strategy in snowflake, which has been optimized to use a temp view instead of table. However, microbatch is still using a temp table! More details: https://docs.getdbt.com/reference/resource-configs/snowflake-configs#temporary-tables

Solution

1) Apply temp view optimization to microbatch. Was just a matter of extending a couple if statements that only checked for insert+delete previously 2) Remove extraneous using clause

Checklist

github-actions[bot] commented 2 months ago

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the dbt-snowflake contributing guide.