Conversation
…nd explicit column selection
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.
Summary\n\nPerformance optimizations for the
attribution_touchesmodel, which currently takes ~137s to rebuild as a full table on every run.\n\n## Changes\n\n### 1. Incremental materialization\n- Changed fromtabletoincrementalwithunique_key = [\"customer_id\", \"order_id\", \"session_id\"].\n- Addedis_incremental()filter onconverted_atin thecustomer_conversionsCTE so only new conversions are processed on subsequent runs.\n\n### 2. Explicit column selection\n- Replaced allSELECT *usage in CTEs (customer_conversions,sessions,sessions_with_sequence,with_attribution_weights,with_points) with explicit column lists.\n- Reduces unnecessary data scanning and shuffling in the warehouse.\n\n## Expected Impact\n- Significantly faster incremental runs (only new conversions processed).\n- Reduced warehouse compute costs.\n- Lower memory usage due to explicit column selection.Created by:
maayan+172@elementary-data.com