Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] <title>sort inserted data to reduce auto-clustering costs #1208

Open
3 tasks done
danielefrigo opened this issue Oct 14, 2024 · 0 comments
Open
3 tasks done
Labels
enhancement New feature or request triage

Comments

@danielefrigo
Copy link
Contributor

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • 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-snowflake functionality, rather than a Big Idea better suited to a discussion

Describe the feature

I know that dbt adds an order by at the end of models materialized as table having a clustering key, in order to reduce (potentially to zero) the auto-clustering costs.
Couldn't the same logic be applied also to append and delete+insert materializations?
I often apply them to models with time-aggregated data (e.g. monthly summaries), and they could surely benefit for such a feature (and I don't see any drawback: in the worst case, the auto-clustering would re-cluster the new data with the old one as it would have done anyway).
I did some testing on my own project, and found that overriding get_insert_into_sql macro should do the trick.

Describe alternatives you've considered

No response

Who will this benefit?

No response

Are you interested in contributing this feature?

No response

Anything else?

No response

@danielefrigo danielefrigo added enhancement New feature or request triage labels Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage
Projects
None yet
Development

No branches or pull requests

1 participant