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

ADAP-835: Optimize manual refresh on auto-refreshed dynamic tables #806

Closed
wants to merge 6 commits into from

Conversation

mikealfare
Copy link
Contributor

resolves dbt-labs/dbt-core#6911

Problem

dbt run will issue a manual refresh of a materialized view if there are no changes detected during a run. This happens regardless of whether the materialized view is setup to be automatically refreshed. If the materialized view is already scheduled to be refreshed, there is no need to insert an additional refresh. This will add cost and potentially introduce unexpected data as the refresh schedule will not match what's set with the extra refresh.

Solution

dbt will inspect the materialized view to determine if it is set to automatically refresh. If it is, and there are no changes, then dbt run will do nothing. If it is not set to automatically refresh, then dbt run will issue a refresh command.

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

@mikealfare mikealfare self-assigned this Oct 14, 2023
@cla-bot cla-bot bot added the cla:yes label Oct 14, 2023
Copy link
Contributor

This PR has been marked as Stale because it has been open with no activity as of late. If you would like the PR to remain open, please comment on the PR or else it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Apr 12, 2024
@mikealfare mikealfare closed this Apr 12, 2024
@mikealfare mikealfare deleted the feature/dynamic-tables/adap-835 branch April 12, 2024 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-2068] [Feature] Let's add Materialized View as a materialization, finally
1 participant