You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues, and I could not find an existing issue for this feature
I am requesting a straightforward extension of existing dbt-adapter functionality, rather than a Big Idea better suited to a discussion
Describe the feature
Right now the 'unique_key' for a snapshot must be a single column or an expression. If a user needs a combination of columns to be unique then they can use the expression to concatenate multiple columns together how they like.
Ideally users would be able to enter a list of columns, just like they can do for incremental models.
Describe alternatives you've considered
I considered adding additional parameters instead of changing the existing unique_key parameter. I think using the existing parameter is best because it's the most consistent with how incremental tables work.
Who will this benefit?
Snapshot users who work in Postgres or Redshift can take advantage of performance optimizations in their databases with this change.
There are performance benefits from using multiple columns rather than an expression. In Postgres users would be able to pass in partition keys or indexed columns to speed up their snapshots, without needing to make an additional expression index. In Redshift users can pass in a separate distribution key to also get performance benefits.
These benefits can't be realized unless dbt allows the unique key to natively be a combination of columns, rather than a concatenation/combination expression.
Are you interested in contributing this feature?
Yes, I have a PR here and in dbt-core coming shortly
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Is this your first time submitting a feature request?
Describe the feature
Right now the 'unique_key' for a snapshot must be a single column or an expression. If a user needs a combination of columns to be unique then they can use the expression to concatenate multiple columns together how they like.
Ideally users would be able to enter a list of columns, just like they can do for incremental models.
Describe alternatives you've considered
I considered adding additional parameters instead of changing the existing
unique_key
parameter. I think using the existing parameter is best because it's the most consistent with how incremental tables work.Who will this benefit?
Snapshot users who work in Postgres or Redshift can take advantage of performance optimizations in their databases with this change.
There are performance benefits from using multiple columns rather than an expression. In Postgres users would be able to pass in partition keys or indexed columns to speed up their snapshots, without needing to make an additional expression index. In Redshift users can pass in a separate distribution key to also get performance benefits.
These benefits can't be realized unless dbt allows the unique key to natively be a combination of columns, rather than a concatenation/combination expression.
Are you interested in contributing this feature?
Yes, I have a PR here and in dbt-core coming shortly
Anything else?
No response
The text was updated successfully, but these errors were encountered: