feat: full_refresh_build config with prebuilt in-place rebuild path#750
Open
Benjamin-Knight wants to merge 1 commit into
Open
feat: full_refresh_build config with prebuilt in-place rebuild path#750Benjamin-Knight wants to merge 1 commit into
Benjamin-Knight wants to merge 1 commit into
Conversation
Add a full_refresh_build model config. `prebuilt` rebuilds a table in
place - drop the old table, recreate it empty with its clustered design
(as_columnstore CCI or the clustered index from the indexes config), then
bulk-load via INSERT WITH (TABLOCK). No intermediate copy or rename swap,
so peak rebuild disk is ~1x instead of ~2x. Default heap_then_index is
unchanged.
- Applies only under --full-refresh and on first builds; normal runs keep
the configured refresh. Takes precedence over table_refresh_method: dml.
- Drops the table, so {{ this }} self-references must be guarded by
is_incremental(); the adapter fails on an unguarded self-reference
before dropping anything.
- Full refreshes mark the target with a dbt_full_refresh_incomplete
extended property until they complete, so a later normal incremental
over a failed refresh errors instead of appending onto stale data.
Builds on the indexes feature shipped in v1.10.1.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds a full_refresh_build model config offering a lower-disk full-refresh rebuild path. Builds on the indexes feature shipped in v1.10.1. Resolve #749
heap_then_indexprebuiltINSERT WITH (TABLOCK). No intermediate copy, no swap → ~1x peak disk instead of ~2x.Behaviour
Performance: parallel index build vs. serial insert (edition matters)
prebuilt swaps the default's post-load CREATE INDEX for an INSERT WITH (TABLOCK) into the existing index:
The ~1x peak-disk benefit holds on every edition; only the time cost is edition-dependent.
Testing