Reduce Snowflake costs: 9 levers ranked by payoff
Most of a Snowflake bill is warehouse time, and much of that time is idle. The levers that actually move the bill, in the order that pays back an hour of effort fastest.
The fastest way to reduce Snowflake costs is to stop paying for warehouses that are running but not working. Snowflake bills virtual warehouse compute per second while a warehouse is running, with a 60-second minimum every time it resumes, and each size step doubles the credits per hour. The default AUTO_SUSPEND on CREATE WAREHOUSE is 600 seconds, so every burst of queries can be followed by up to ten minutes of billed idle time. On a warehouse that serves a dashboard refreshing every few minutes, it may never suspend at all. Snowflake’s own WAREHOUSE_METERING_HISTORY view separates credits spent running queries from credits spent idle, so you can measure this before changing anything. After idle time come the levers that need more thought: right-sizing by measurement, separating workloads, fixing the queries that scan too much, controlling what your BI tool fires, and auditing serverless features and storage. Here are nine levers, ordered by savings per hour of effort, with the SQL for each.
Where does a Snowflake bill come from?
Snowflake’s cost overview splits usage into three categories: compute, storage and data transfer.
- Compute is mostly virtual warehouse credits. On top of that sit cloud services (compilation, metadata, the query optimizer), which are charged only for the part of a day’s usage above 10% of that day’s warehouse usage, and serverless features such as automatic clustering, materialized view maintenance, search optimization and the query acceleration service, which run on compute Snowflake provides and bill separately.
- Storage is a flat rate per terabyte per month, based on the average bytes stored each day, including Time Travel and Fail-safe history.
- Data transfer is free into Snowflake and charged per terabyte out of it, when data moves to another region or another cloud.
Warehouse credits scale with size. For standard (Gen1) warehouses, per the warehouse overview:
| Size | Credits per hour |
|---|---|
| X-Small | 1 |
| Small | 2 |
| Medium | 4 |
| Large | 8 |
| X-Large | 16 |
| 2X-Large | 32 |
| 3X-Large | 64 |
| 4X-Large | 128 |
New standard warehouses can default to Gen2 compute where your region offers it (the CREATE WAREHOUSE reference ties the default to Gen2 availability in your cloud region), and Gen2 has its own credit rates in Snowflake’s Service Consumption Table, so check which generation your warehouses run before you compare numbers. And the dollar price of a credit depends on your edition, region and contract, which is why this playbook talks in credits.
How do you find what is costing you money?
Measure before you tune. Three queries against the SNOWFLAKE.ACCOUNT_USAGE share answer most of the question. You need a role with access to it; by default that is ACCOUNTADMIN.
Idle credits per warehouse. CREDITS_ATTRIBUTED_COMPUTE_QUERIES excludes idle time, so the difference is what you paid for a running warehouse with nothing to do:
SELECT warehouse_name,
SUM(credits_used_compute) AS compute_credits,
SUM(credits_attributed_compute_queries) AS query_credits,
SUM(credits_used_compute)
- SUM(credits_attributed_compute_queries) AS idle_credits
FROM snowflake.account_usage.warehouse_metering_history
WHERE start_time >= DATEADD('day', -30, CURRENT_DATE())
AND end_time < CURRENT_DATE()
GROUP BY warehouse_name
ORDER BY idle_credits DESC;
The most expensive query shapes. QUERY_ATTRIBUTION_HISTORY assigns credits to individual queries, and query_parameterized_hash groups runs of the same query that differ only in literal values. That is how a single dashboard tile fired 5,000 times a day shows up as one line:
SELECT query_parameterized_hash,
ANY_VALUE(warehouse_name) AS warehouse,
ANY_VALUE(user_name) AS sample_user,
COUNT(*) AS runs,
SUM(credits_attributed_compute) AS credits
FROM snowflake.account_usage.query_attribution_history
WHERE start_time >= DATEADD('day', -30, CURRENT_DATE())
GROUP BY query_parameterized_hash
ORDER BY credits DESC
LIMIT 25;
The view excludes idle time and queries of roughly 100 ms or less, and can lag by up to eight hours. Join to QUERY_HISTORY on query_id to see the SQL text.
Snowflake’s own hints. Snowsight’s Admin > Cost management > Account Overview page has an Optimization insights tile, refreshed weekly. It flags, among others, warehouses idle more than half the time they are active, automatically clustered tables queried under 100 times a week, materialized views queried under 10 times a week, and large tables nobody has queried in a week.
Lever 1: Lower auto-suspend on every warehouse
This is the highest payoff per minute of work. Snowflake’s warehouse considerations recommend a low value, “for example, 5 or 10 minutes or less”, matched to the gaps in your workload. The CREATE WAREHOUSE reference notes that the suspend process runs about every 30 seconds, so use multiples of 30.
-- Find warehouses that never suspend or wait long to do so
SHOW WAREHOUSES;
SELECT "name", "size", "auto_suspend", "auto_resume"
FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()))
WHERE "auto_suspend" IS NULL OR "auto_suspend" = 0 OR "auto_suspend" > 300;
-- ELT and ad-hoc warehouses: suspend quickly
ALTER WAREHOUSE transform_wh SET AUTO_SUSPEND = 60;
-- BI warehouse: a little longer, to keep the local cache warm between clicks
ALTER WAREHOUSE bi_wh SET AUTO_SUSPEND = 180;
A suspended warehouse drops its local data cache, so the first queries after a resume read from remote storage again. And every resume bills at least 60 seconds, so a warehouse that suspends and wakes every minute pays a minimum each time. A batch ELT warehouse whose jobs run back to back can suspend almost immediately; an interactive BI warehouse benefits from a few minutes of grace. AUTO_SUSPEND = 0 or NULL means never suspend, which Snowflake advises against unless the workload truly needs a warehouse that runs constantly.
Lever 2: Put a ceiling on every warehouse
This caps the waste you have not found yet: a runaway query, a looping job, a tool polling every ten seconds.
Resource monitors set a credit quota per period and act at thresholds. Only ACCOUNTADMIN can create them, and each monitor can carry one suspend action, one suspend-immediately action and up to five notify actions:
CREATE RESOURCE MONITOR bi_monthly
WITH CREDIT_QUOTA = 300
FREQUENCY = MONTHLY
START_TIMESTAMP = IMMEDIATELY
TRIGGERS ON 75 PERCENT DO NOTIFY
ON 100 PERCENT DO SUSPEND
ON 110 PERCENT DO SUSPEND_IMMEDIATE;
ALTER WAREHOUSE bi_wh SET RESOURCE_MONITOR = bi_monthly;
Resource monitors cover warehouses (and the cloud services behind them) only. Serverless features and AI services need a budget instead, which is the tool Snowflake recommends for them.
Then cap individual statements. STATEMENT_TIMEOUT_IN_SECONDS defaults to 172,800 seconds, which is two days, so a bad query on an X-Large warehouse could run for 48 hours at 16 credits an hour before anything stops it. Set it per warehouse to something that fits the workload:
ALTER WAREHOUSE bi_wh SET STATEMENT_TIMEOUT_IN_SECONDS = 300;
ALTER WAREHOUSE transform_wh SET STATEMENT_TIMEOUT_IN_SECONDS = 7200;
Account, user and session values override each other in the usual order; when both the warehouse and the session set it, the lower non-zero of the two wins.
Lever 3: Right-size warehouses by measurement, not by habit
A warehouse that is one size too big doubles its cost per hour. It is only worth it if queries finish in about half the time, because a query that runs twice as fast on twice the credits costs the same. Snowflake’s own guidance is to run the same queries on several sizes and compare, and it warns that “larger is not necessarily faster for smaller, more basic queries”. A dashboard query that reads a few megabytes has little to gain from more compute.
The signals that a warehouse is too small are specific. Spilling is the clearest:
SELECT warehouse_name, warehouse_size,
COUNT(*) AS queries,
SUM(IFF(bytes_spilled_to_remote_storage > 0, 1, 0)) AS remote_spills,
SUM(IFF(bytes_spilled_to_local_storage > 0, 1, 0)) AS local_spills,
MEDIAN(execution_time) / 1000 AS median_exec_s
FROM snowflake.account_usage.query_history
WHERE start_time >= DATEADD('day', -14, CURRENT_TIMESTAMP())
AND warehouse_name IS NOT NULL
GROUP BY 1, 2
ORDER BY remote_spills DESC;
Snowflake’s guidance on spilling is to use a larger warehouse or process the data in smaller batches. Spilling to remote storage is slower than spilling to local storage. A warehouse with no spills and short median execution times is a candidate to step down one size: try it for a week and compare credits and p95 latency.
Queuing is a different problem. If queued_overload_time is high, queries are waiting for a slot, not running slowly. Snowflake states that resizing “is not intended for handling concurrency issues”; the fix is a separate warehouse or a multi-cluster one (Lever 4).
Lever 4: Give each workload its own warehouse
One big shared warehouse is sized for its heaviest job and stays awake for its chattiest one. Splitting by workload lets each warehouse be sized and suspended on its own terms:
| Warehouse | Typical size | Auto-suspend | Timeout |
|---|---|---|---|
transform_wh (scheduled ELT and dbt) | Medium or larger, by measurement | 60 s | hours |
bi_wh (dashboards, embedded) | X-Small or Small | 120 to 300 s | minutes |
adhoc_wh (analysts, notebooks) | Small | 60 s | under an hour |
Separate warehouses also make the metering query above show what ELT, BI and exploration each cost.
For concurrency, a multi-cluster warehouse (Enterprise Edition and above) adds clusters only when queries queue. Two settings decide its cost. Auto-scale mode (maximum clusters above minimum) is cheaper than maximized mode, which starts every cluster at once; Snowflake’s example puts a Medium warehouse with three clusters over two hours at 24 credits maximized against 14 auto-scaled. And the ECONOMY scaling policy only starts a new cluster if it estimates enough load to keep it busy for six minutes, trading some queuing for fewer clusters. Optimization insights flags multi-cluster warehouses whose minimum equals their maximum for this reason.
Lever 5: Fix the queries that scan too much
Once idle time is gone, the bill tracks work done, and work done tracks bytes scanned. Snowflake stores tables as micro-partitions with min and max metadata per column, and a filter that matches that metadata lets it skip partitions. Compare partitions_scanned to partitions_total for your most expensive queries:
SELECT query_parameterized_hash,
COUNT(*) AS runs,
AVG(partitions_scanned / NULLIF(partitions_total, 0)) AS scan_ratio,
SUM(bytes_scanned) / POWER(1024, 3) AS gb_scanned,
ANY_VALUE(LEFT(query_text, 200)) AS sample_sql
FROM snowflake.account_usage.query_history
WHERE start_time >= DATEADD('day', -7, CURRENT_TIMESTAMP())
AND partitions_total > 1000
GROUP BY 1
ORDER BY gb_scanned DESC
LIMIT 20;
A scan ratio near 1 on a big table means the query reads everything. The usual causes and fixes:
- No filter on the column the data is ordered by. Data loaded in time order prunes well on date filters. A dashboard with no date range reads the whole history; add a default range.
SELECT *from wide tables. Snowflake is columnar, so every extra column is extra bytes. Name the columns, especially in views that BI tools wrap.- Full rebuilds of large models. A transformation that recreates a multi-year fact table every hour pays to rescan history that has not changed. Incremental models that process only new or changed rows usually cut transform credits more than any warehouse setting.
- Join explosions. A join on a non-unique key multiplies rows and then hides it behind a
DISTINCT. Check the Query Profile for a join whose output dwarfs its inputs.
Lever 6: Control the query load your BI tool generates
BI tools can be the largest source of queries in an account, and they generate cost in ways that do not show up as one slow query.
Auto-refresh keeps warehouses awake. A dashboard that refreshes every five minutes, against a warehouse with a ten-minute auto-suspend, keeps that warehouse running for as long as the dashboard is open somewhere, including on a wall screen nobody is watching. Match refresh intervals to how often the data actually lands. If your pipeline loads hourly, a five-minute refresh re-queries unchanged data eleven times out of twelve.
Lean on the result cache, and know what breaks it. Snowflake’s persisted query results let an identical query skip execution entirely. A result is kept for 24 hours, each reuse resets that clock, and the limit is 31 days after the first run. Reuse requires the query text to match exactly (a different alias or lowercase keywords is enough to miss), the underlying data to be unchanged, no non-reusable functions such as RANDOM or UUID_STRING, and a role with access to every table involved. Tools that inject per-user comments, randomised aliases or per-request timestamps into SQL defeat it.
Watch cloud services from metadata chatter. Snowflake’s guide to optimizing cloud services lists high-frequency SHOW commands, INFORMATION_SCHEMA queries and trivial queries like SELECT CURRENT_SESSION() among the patterns that push cloud services over the 10% line.
Tag the traffic. Give each BI tool its own Snowflake user and warehouse, or set a QUERY_TAG on its user, so the attribution query can tell you which tool, and ideally which dashboard, is spending the credits.
Pre-aggregate the hot path. If the same 20 dashboard queries run thousands of times a day against raw facts, a small aggregated table refreshed after each load answers them for a fraction of the scan. Defining those aggregates once in a semantic layer, instead of in every dashboard, keeps them consistent; what is a semantic layer covers the pattern.
Lever 7: Audit clustering, materialized views and search optimization
Automatic clustering reclusters a table as data changes. Snowflake’s clustering key guidance says keys are typically worth it on tables of multiple terabytes, queried selectively and often on the same few columns, and changed rarely. Reclustering costs credits and also storage, because the replaced micro-partitions are retained for Time Travel and Fail-safe. On a heavily updated table, it can cost more than it saves. Keep keys to three or four columns at most, and for timestamps cluster on an expression such as TO_DATE(event_ts) rather than the raw value.
Materialized views (Enterprise Edition) are maintained as base tables change, whether or not anyone reads them. Search optimization maintains access paths in the same way. The Optimization insights tile flags rarely used examples of all three. Suspend or drop what is not earning its keep:
ALTER TABLE events SUSPEND RECLUSTER;
ALTER MATERIALIZED VIEW mv_daily_orders SUSPEND;
ALTER TABLE customers DROP SEARCH OPTIMIZATION;
Then confirm in SNOWFLAKE.ACCOUNT_USAGE.AUTOMATIC_CLUSTERING_HISTORY and the matching views for the other features that their credits fall.
Lever 8: Trim storage you are paying to keep
Storage is often a smaller line than compute, but it compounds quietly, and the fixes are mostly one-line settings.
- Time Travel retention.
DATA_RETENTION_TIME_IN_DAYSdefaults to 1 and can go up to 90 on Enterprise Edition. Ninety days of history on a table rewritten daily stores many copies of the changed data. Keep long retention for the tables where you would actually restore. - Fail-safe on scratch data. Permanent tables add seven days of Fail-safe on top of Time Travel. Transient and temporary tables have no Fail-safe and at most one day of Time Travel, so use them for staging and intermediate ELT tables that can be rebuilt from source:
CREATE TRANSIENT TABLE staging.orders_load (...) DATA_RETENTION_TIME_IN_DAYS = 0;
-- Or make a whole schema transient so every new table in it inherits that
CREATE TRANSIENT SCHEMA staging_scratch;
- Tables nobody reads. Optimization insights flags large tables not queried in a week, tables over 100 GB that are written but never read, and permanent tables over 100 GB dropped within a day of creation, which still pay for Fail-safe.
Lever 9: Move the hottest workload to an engine built for it
If the levers above are done and the remaining spend is dominated by a warehouse that serves interactive dashboards or embedded analytics all day, the cost is structural: a warehouse is billed for every second it stays up, and a busy dashboard keeps it up. One option is to keep Snowflake for transformation and ad-hoc work and serve the hot, repetitive dashboard queries from a columnar engine sized for that pattern, such as ClickHouse. ClickHouse vs Snowflake for BI walks through where each engine fits, and sizing a ClickHouse cluster for a data team of 20 covers what the second engine costs to run. It is a real migration, so do it for a measured reason, not as a first step.
Goni is one way to set that up. Full disclosure: this is our product. It connects to Snowflake as a source (full and incremental ingestion), lands the data in a ClickHouse warehouse, and serves dashboards, alerts, scheduled reports, embedding and AI Q&A from metrics defined once in a YAML semantic layer. The drawbacks: ClickHouse is the only warehouse Goni queries, so it does not run your dashboards on Snowflake itself; it adds a second system to your stack; and it is not open source. If that trade fits, the 14-day free trial is the quickest way to test it against your own query history.
FAQ
What is the fastest way to reduce Snowflake costs?
Lower AUTO_SUSPEND on every warehouse. The CREATE WAREHOUSE default is 600 seconds, and Snowflake bills every second a warehouse runs, idle or not. Measure idle credits first with WAREHOUSE_METERING_HISTORY, then set batch warehouses to about 60 seconds and interactive BI warehouses to a few minutes, so the cache survives between clicks.
What should Snowflake auto-suspend be set to?
Snowflake recommends a low value, such as 5 or 10 minutes or less, matched to the gaps in your workload. Batch ELT warehouses can use 60 seconds. BI warehouses often do better at 2 to 5 minutes, because suspending drops the local data cache and every resume bills a 60-second minimum. Use multiples of 30 seconds.
Does a bigger Snowflake warehouse cost more?
Per hour, yes: each size step doubles the credits. Per query, not necessarily. A query that runs in half the time on a warehouse twice the size costs the same, and one that spills to remote storage can get cheaper. Small dashboard queries often just cost more. Test the same queries on two sizes and compare credits.
Does the Snowflake result cache save credits?
It can. A persisted result lets an identical query skip execution, and results stay available for 24 hours, extended with each reuse up to 31 days. The query text must match exactly, the data must be unchanged and the query cannot use functions like RANDOM. BI tools that alter SQL per request miss the cache.
How do I see which queries cost the most in Snowflake?
Query SNOWFLAKE.ACCOUNT_USAGE.QUERY_ATTRIBUTION_HISTORY, which assigns compute credits to individual queries, and group by query_parameterized_hash so repeated runs of one dashboard query appear as a single line. It excludes warehouse idle time and very short queries, and lags by up to eight hours, so pair it with WAREHOUSE_METERING_HISTORY for idle cost.