Workload
Performance tuning & optimization for Teradata → Snowflake
Teradata tuning habits (spool management, index/PI assumptions, and optimizer-specific shapes) don’t translate. We tune Snowflake layout, query shapes, and warehouse posture so pruning works, credits stay stable, and refresh SLAs hold under real concurrency.
Quick answer
Teradata tuning habits (spool management, index/PI assumptions, and optimizer-specific shapes) don’t translate. We tune Snowflake layout, query shapes, and warehouse posture so pruning works, credits stay stable, and refresh SLAs hold under real concurrency.
Back to pair pageContext
Why this breaks
Teradata performance tuning is often encoded in physical design and platform behavior: PI/index assumptions, spool management, and optimizer-driven query plans. After migration, teams keep Teradata-era query shapes and expect Snowflake to behave similarly—then costs spike and SLAs slip because Snowflake’s model is different. In Snowflake, credit burn is driven by warehouse usage and scan footprint, and MERGE/apply workloads can become full-target scans without bounded scope. Common post-cutover symptoms:
- Queries scan too much because predicates don’t prune effectively - Join-heavy reporting reshuffles large datasets; BI latency increases - MERGE/apply jobs scan full targets; credit burn becomes unpredictable - BI refresh contends with batch loads without warehouse isolation - Improvements regress because there are no baselines or gates
Approach
How conversion works
- Baseline top workloads: identify the most expensive and most business-critical queries/pipelines (dashboards, marts, incremental loads). - Diagnose root causes: pruning effectiveness, join patterns, large scans, and MERGE scope. - Tune data layout: evidence-driven clustering where beneficial based on access paths (not folklore). - Rewrite for bounded applies: staged apply, bounded MERGE scopes, and pruning-friendly predicates. - Warehouse posture: isolate batch vs BI warehouses, tune concurrency and sizing, and implement credit guardrails. - Regression gates: store baselines and enforce thresholds so improvements persist.
Coverage
Supported constructs
Representative tuning levers we apply for Teradata → Snowflake workloads.
| Source | Target | Notes |
|---|---|---|
| PI/index-era performance assumptions | Pruning-first predicates + evidence-driven clustering | Replace physical tuning with scan-footprint reduction. |
| Spool-sensitive query shapes | Bounded scans + staged materializations | Reduce large intermediate explosions and stabilize runtime. |
| MERGE/upsert pipelines | Bounded MERGE scopes + staged apply | Avoid full-target scans and unpredictable credit burn. |
| Join-heavy BI workloads | Pruning-aware rewrites + pre-aggregation/materializations | Stabilize dashboards and reduce repeated large scans. |
| Mixed BI + batch contention | Warehouse isolation + concurrency posture | Prevent batch workloads from impacting BI latency. |
| Ad-hoc cost spikes | Governance guardrails + regression gates | Prevent credit blowups from unmanaged changes. |
Compare
How workload changes
| Topic | Teradata | Snowflake | Notes |
|---|---|---|---|
| Primary cost driver | Platform capacity + spool behavior | Warehouse credits + scan footprint | Pruning and bounded scans dominate credit burn. |
| Data layout impact | PI/indexes and optimizer behavior | Clustering is optional and evidence-driven | Use clustering only when predicates/join keys justify it. |
| Incremental apply | MERGE logic often coupled to Teradata semantics | Bounded MERGE/apply windows + staged apply | Correctness and cost depend on apply window design. |
| Concurrency planning | Workload management queues | Warehouse isolation + concurrency policies | Peak BI refresh needs explicit warehouse posture. |
Examples
Examples
Illustrative Snowflake optimization patterns after Teradata migration: enforce pruning-friendly filters, bound MERGEs, isolate warehouses, and store baselines for regression gates.
-- Pruning-first query shape (avoid wrapping filter columns)
SELECT
region,
SUM(revenue) AS rev
FROM MART.FACT_ORDERS
WHERE EVENT_DATE BETWEEN DATE '2025-01-01' AND DATE '2025-01-31'
GROUP BY 1; -- Bound MERGE scope to affected window
SET min_d = (SELECT MIN(TO_DATE(updated_at)) FROM STG_ORDERS);
SET max_d = (SELECT MAX(TO_DATE(updated_at)) FROM STG_ORDERS);
MERGE INTO MART.FACT_ORDERS t
USING STG_ORDERS s
ON t.id = s.id
AND TO_DATE(t.updated_at) BETWEEN $min_d AND $max_d
WHEN MATCHED THEN UPDATE SET
t.status = s.status,
t.amount = s.amount,
t.updated_at = s.updated_at
WHEN NOT MATCHED THEN
INSERT (id, status, amount, updated_at)
VALUES (s.id, s.status, s.amount, s.updated_at); -- Store baselines for regression gates (simplified)
CREATE TABLE IF NOT EXISTS CONTROL.PERF_BASELINES (
artifact_id STRING,
captured_at TIMESTAMP_NTZ,
runtime_ms NUMBER,
credits NUMBER
); Workload Assessment
Replace Teradata tuning with Snowflake-native pruning
We identify your highest-cost migrated workloads, tune pruning and apply windows, and deliver before/after evidence with regression thresholds—so performance improves and stays stable.
Book assessmentAvoid
Common pitfalls
- Carrying over PI/index thinking: expecting physical design to rescue query shape; Snowflake needs pruning-first predicates and evidence-driven clustering.
- Clustering by folklore: clustering keys chosen without evidence from predicates/join keys.
- Full-target MERGE: missing apply boundaries causes large scans and credit spikes.
- No warehouse isolation: BI and batch share warehouses; tail latency and spend spikes follow.
- Over-materialization: too many intermediates without controlling refresh cost.
- No regression gates: performance improves once, then regresses silently.
Proof
Validation approach
- Baseline capture: runtime, scan footprint, and credits for top queries/pipelines.
- Pruning checks: confirm pruning-friendly predicates and reduced scan footprint on representative parameters.
- Before/after evidence: demonstrate improvements in runtime and credit burn; document tradeoffs.
- Correctness guardrails: golden queries and KPI aggregates ensure tuning doesn’t change semantics.
- Regression thresholds: define alerts (e.g., +30% credits or +30% runtime) and enforce via CI or scheduled checks.
- Operational monitors: dashboards for warehouse utilization, credit burn, failures, and refresh SLA adherence.
Execution
Migration steps
A sequence that improves performance while protecting semantics.
-
01
Identify top cost and SLA drivers
Rank queries and pipelines by credits, runtime, and business criticality (dashboards, batch windows). Select a tuning backlog with clear owners.
-
02
Create baselines and targets
Capture current Snowflake metrics (runtime, credit burn, scan footprint) and define improvement targets. Freeze golden outputs so correctness doesn’t regress.
-
03
Tune layout and apply posture
Apply evidence-driven clustering where beneficial and redesign apply windows so MERGEs are bounded and pruning remains effective.
-
04
Rewrite for pruning and reuse
Apply pruning-aware rewrites, reduce repeated large scans with materializations where needed, and scope MERGEs to affected windows.
-
05
Warehouse posture and governance
Isolate batch and BI warehouses, tune concurrency, and implement guardrails to prevent credit blowups from new queries.
-
06
Add regression gates
Codify performance thresholds and alerting so future changes don’t reintroduce high credit burn or missed SLAs. Monitor post-cutover metrics continuously.
FAQ
Frequently asked questions
Why did credits increase after moving from Teradata to Snowflake? +
Most often because Teradata-era query shapes and MERGE conventions translate into larger scans in Snowflake. We tune pruning-friendly predicates, bound MERGE scopes, and isolate warehouses to stabilize credit burn.
Do we need clustering everywhere? +
No. Clustering is most useful for large tables with stable, selective predicates. We use evidence from query patterns and scan behavior before recommending clustering keys.
Can you optimize MERGE/apply pipelines too? +
Yes. We scope MERGEs to affected windows, design staging boundaries, and validate performance with credit/runtime baselines to prevent unpredictable scans.
How do you prevent BI refresh from impacting batch pipelines? +
We isolate warehouses (or use workload-aware sizing and concurrency limits) so BI and batch don’t contend. Monitoring and regression gates catch credit spikes and SLA regressions early.
Optimization Program
Prevent credit blowups with regression gates
Get an optimization backlog, bounded apply patterns, and performance gates (credit/runtime thresholds) so future releases don’t reintroduce slow dashboards or high credit burn.
Next reads
Related pages
- Read more
End-to-end approach: what breaks, validation gates, and cutover plan.
- Read more
Migrate Teradata pipelines with restartability and bounded MERGE patterns.
- Read more
Convert Teradata SQL to Snowflake with QUALIFY parity and golden-query validation.
- Read more
Migrate macros/procs/UDFs into Snowflake routines with a replayable harness.
- Read more
Use when migration exposes broader platform architecture, cost, or performance questions.