This repository was archived by the owner on Sep 2, 2025. It is now read-only.
[Microbatch] Optimizations: use view for temp relation + remove using clause during delete statement#1192
Merged
MichelleArk merged 6 commits intomainfrom Nov 6, 2024
Merged
Conversation
Contributor
|
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. |
using clause during insert
using clause during insertusing clause during delete statement
QMalcolm
approved these changes
Nov 5, 2024
| {% elif strategy in ("default", "merge", "append") %} | ||
| {{ return("view") }} | ||
| {% elif strategy == "delete+insert" and unique_key is none %} | ||
| {% elif strategy in ["delete+insert", "microbatch"] and unique_key is none %} |
Contributor
There was a problem hiding this comment.
🚀 This is a greeeeaaaat catch! Nice!
colin-rogers-dbt
approved these changes
Nov 5, 2024
QMalcolm
approved these changes
Nov 5, 2024
mikealfare
approved these changes
Nov 6, 2024
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves #1228
docs dbt-labs/docs.getdbt.com/# N/A
Problem
Microbatch performance is underwhelming for dbt-snowflake! A couple underlying reasons:
unique_keynecessaryusingclause is unnecessary in the microbatchdeletestatement, because microbatch does not require a merge key and thewhereclause is sufficient for a safe deletion.Solution
usingclauseChecklist