Library · Data Practice OS
Cost control on Snowflake
Reference guide · Published · Source reviewed
Snowflake bills for what you use: compute credits for warehouses, serverless features and Cortex, storage per terabyte per month, and data transfer when data leaves the region. Compute is usually 70-90% of the bill. That is good news, because it is also the part you control.
Where the money goes
| Cost driver | Typical cause of waste | Guardrail |
|---|---|---|
| Warehouses | Oversized, long auto-suspend, one shared warehouse for everything | Small by default, AUTO_SUSPEND = 60, one warehouse per workload |
| Serverless (Snowpipe, Dynamic Tables, search optimisation, clustering) | Targets that are fresher than anyone needs | Set TARGET_LAG to the business need, not "as fast as possible" |
| Cortex AI | AI functions over whole tables, repeated on every run | Process new rows only, and cache results in columns |
| Cortex Search and Analyst | Indexes that refresh far more often than the content changes | Match the lag to the content's change rate |
| Storage | Long time-travel retention on large, churning tables | Set retention per table class |
| Egress | Copying data out to other clouds or regions | Share in place, and read Iceberg in-region |
Guardrails to set on day one
-- Hard ceiling per workload
CREATE RESOURCE MONITOR rm_transform WITH CREDIT_QUOTA = 400
FREQUENCY = MONTHLY START_TIMESTAMP = IMMEDIATELY
TRIGGERS ON 75 PERCENT DO NOTIFY
ON 100 PERCENT DO SUSPEND
ON 110 PERCENT DO SUSPEND_IMMEDIATE;
ALTER WAREHOUSE wh_transform SET RESOURCE_MONITOR = rm_transform;
-- Stop runaway queries
ALTER WAREHOUSE wh_bi SET STATEMENT_TIMEOUT_IN_SECONDS = 1800;
- Budgets cover serverless and AI spend that resource monitors do not. Set one per domain or project.
- Tag warehouses and databases with
cost_centreanddomainso spend lands with the team that caused it (FinOps). - Put every warehouse definition in Terraform, so sizes change through review rather than by clicking.
Make it visible
The SNOWFLAKE.ACCOUNT_USAGE views (WAREHOUSE_METERING_HISTORY, QUERY_ATTRIBUTION_HISTORY,
METERING_DAILY_HISTORY, and the Cortex usage views) are the raw material for a cost dashboard. Build it in
the first month and review it weekly.
SELECT warehouse_name,
DATE_TRUNC('week', start_time) AS wk,
SUM(credits_used) AS credits
FROM snowflake.account_usage.warehouse_metering_history
WHERE start_time >= DATEADD(month, -3, CURRENT_DATE)
GROUP BY 1, 2
ORDER BY 2 DESC, 3 DESC;
AI-specific cost habits
- Test on a sample. Run the AI function on 1,000 rows, measure credits, and multiply before running it on 10 million.
- Enrich once. Store the classification or extraction result; never call the model again at dashboard query time. See AI on Snowflake - Cortex.
- Use the smallest model that passes evaluation. Large models are not the default. The evaluation set (Evaluating AI systems) decides.
- Give AI its own warehouse and budget so it is visible separately and can be capped separately.
Commercial
Capacity (pre-purchased credits) is cheaper than on-demand once usage is predictable. Do not commit before you have three to six months of real consumption data. Check whether a whole-of-government or whole-of-government or enterprise arrangement already exists before negotiating alone.
Pitfalls
- Sizing up to fix a slow query. Fix the query (pruning, clustering, joins) first. Doubling the size doubles the cost per second.
- Leaving BI warehouses always on with a long auto-suspend for "faster first query". The result cache and a 5-minute suspend usually suffice.
- Dev and test running at production size.
- Forgetting cloud services charges, which become visible when thousands of tiny queries hit metadata.
Worked example
In its first quarter, the safety analytics team's spend tripled. Attribution showed one Dynamic Table at a
1-minute lag over crash data that changes daily, and an AI_CLASSIFY call inside a view that Power BI
refreshed hourly. Setting the lag to 1 day and moving classification into the incremental pipeline cut the
team's credits by about 80%. Neither change touched a report.
Compare with Cost control on Databricks when weighing platforms. Verify current pricing, credit rates for Cortex models and editions with Snowflake or the whole-of-government or enterprise procurement arrangement.