Snowflake cost optimization: the engineering guide
Most Snowflake bills contain 30–60% waste, concentrated in four buckets: idle compute, oversized warehouses, repeated identical queries, and unattributed spend nobody owns. This guide covers how to measure and eliminate each, in the order that pays back fastest.
The optimization hierarchy
- Suspend idle warehouses — biggest lever, zero risk
- Right-size warehouses — second biggest, low risk
- Cache repeated reads — high value for BI-heavy workloads
- Rewrite expensive SQL — long tail, per-query wins
1. Find idle spend
Warehouses bill per-second with a 60-second minimum while running — including time spent doing nothing after the last query:
SELECT warehouse_name,
SUM(credits_used) AS credits,
COUNT(DISTINCT date_trunc(hour, start_time)) AS active_hours
FROM SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY
WHERE start_time >= DATEADD(day, -30, CURRENT_TIMESTAMP())
GROUP BY 1 ORDER BY 2 DESC;
Compare metered hours against actual query activity in QUERY_HISTORY;
the gap is idle burn. Fixes: aggressive AUTO_SUSPEND values per workload,
and automated idle detection (chukei's suspend plugin runs suggest-only
first, then enforce — in 30-day simulation suspension was ~94% of total
savings).
2. Right-size warehouses
Each size doubles credits per hour. A warehouse that never spills to remote storage and finishes queries in milliseconds is oversized — drop a size and re-measure.
3. Stop paying for the same query twice
Snowflake's result cache helps less than expected for BI traffic: it requires exact text matches and is invalidated aggressively. Dashboards re-issue near-identical queries all day. Options: materialized views (you pay maintenance), or deterministic proxy-side caching that fingerprints queries structurally and verifies correctness by sampling hits against live Snowflake.
4. Attribute spend to teams
You cannot fix what nobody owns. Attribution options, in increasing power:
warehouse-per-team (multiplies idle cost), QUERY_TAG discipline (decays),
or wire-level attribution where every query is tagged at a proxy by user,
application, and dbt model automatically.
Measure before and after
Whatever you change, reconcile against the bill:
WAREHOUSE_METERING_HISTORY for the period vs the prior period, and keep
an auditable ledger of what each optimization avoided. chukei produces
Ed25519-signed savings evidence for exactly this purpose.
Next: Install chukei or replay your own QUERY_HISTORY to see projected numbers before deploying anything.