Skip to content

Maayan via Elementary: Optimize attribution_touches: incremental materialization & explicit column selection#930

Open
joostboon wants to merge 1 commit intomasterfrom
elementary-optimize-attribution-touches-k7m3x9-154709
Open

Maayan via Elementary: Optimize attribution_touches: incremental materialization & explicit column selection#930
joostboon wants to merge 1 commit intomasterfrom
elementary-optimize-attribution-touches-k7m3x9-154709

Conversation

@joostboon
Copy link
Copy Markdown
Collaborator

Summary\n\nPerformance optimizations for the attribution_touches model, which currently takes ~137s to rebuild as a full table on every run.\n\n## Changes\n\n### 1. Incremental materialization\n- Changed from table to incremental with unique_key = [\"customer_id\", \"order_id\", \"session_id\"].\n- Added is_incremental() filter on converted_at in the customer_conversions CTE so only new conversions are processed on subsequent runs.\n\n### 2. Explicit column selection\n- Replaced all SELECT * 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

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.

1 participant