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

Added incremental predicates to Snowflakes tables #198

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

luislema79
Copy link

@luislema79 luislema79 commented Jun 4, 2023

Added incremental predicates to Snowflake satellites and hubs to limit the scan on the destination table (satellite/hub). When adding new records to a satellite the latest_records cte pulls data from your satellite without any filtering so it doesn't limit the amount of data it pulls and it scans all the partitions in the satellite. The same happens in the records_to_insert cte for a hub. For a big satellite/hub with billions of records, this process takes several minutes. If you don't scan the whole table you run the risk to insert duplicates. However, if you know you might only get duplicates within 3 months you can limit the scan on the table to the last 3 months so you don't scan years worth of data, that way you speed up the incremental process dramatically.

@luislema79 luislema79 changed the title Added incremental predicates Added incremental predicates to Snowflakes satellites Jun 4, 2023
@luislema79 luislema79 changed the title Added incremental predicates to Snowflakes satellites Added incremental predicates to Snowflakes tables Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant