# Snowflake warehouse sizing: speed, credits and the cost of idle time

Bigger warehouses finish faster but burn credits faster too. Run a twelve-query BI refresh at every Snowflake size, see where the money goes, including the idle seconds before auto-suspend, and find the size that is fast enough without paying for nothing.

<div data-sim="specx" data-spec="{&quot;level&quot;:&quot;intermediate&quot;,&quot;head&quot;:&quot;Sizing a Snowflake virtual warehouse: speed against credits&quot;,&quot;sub&quot;:&quot;Twelve queries of a BI refresh. Pick a warehouse size and see how long the batch takes, how many credits it burns and what it costs, query by query.&quot;,&quot;params&quot;:[{&quot;id&quot;:&quot;size&quot;,&quot;label&quot;:&quot;Warehouse size (0 = X-Small, 7 = 4X-Large)&quot;,&quot;min&quot;:0,&quot;max&quot;:7,&quot;step&quot;:1,&quot;value&quot;:2,&quot;note&quot;:&quot;Each step up doubles the credits per hour&quot;},{&quot;id&quot;:&quot;eff&quot;,&quot;label&quot;:&quot;Scaling efficiency&quot;,&quot;min&quot;:0.3,&quot;max&quot;:1,&quot;step&quot;:0.05,&quot;value&quot;:0.85,&quot;note&quot;:&quot;1 = each size step halves run time; real queries often scale less&quot;},{&quot;id&quot;:&quot;suspend&quot;,&quot;label&quot;:&quot;Auto-suspend&quot;,&quot;min&quot;:60,&quot;max&quot;:600,&quot;step&quot;:30,&quot;value&quot;:300,&quot;unit&quot;:&quot;s&quot;,&quot;note&quot;:&quot;Idle seconds billed before the warehouse suspends&quot;},{&quot;id&quot;:&quot;price&quot;,&quot;label&quot;:&quot;Price per credit&quot;,&quot;min&quot;:2,&quot;max&quot;:4,&quot;step&quot;:0.5,&quot;value&quot;:3,&quot;unit&quot;:&quot;$&quot;}],&quot;data&quot;:{&quot;columns&quot;:[&quot;query&quot;,&quot;work_xs&quot;],&quot;rows&quot;:[[1,4],[2,6],[3,9],[4,15],[5,22],[6,35],[7,48],[8,70],[9,95],[10,140],[11,210],[12,320]],&quot;note&quot;:&quot;An illustrative BI refresh: seconds each query takes on an X-Small warehouse, run back to back. Replace work_xs with the run times from your own query history (QUERY_HISTORY, TOTAL_ELAPSED_TIME on X-Small) to size your warehouse.&quot;},&quot;pre&quot;:[{&quot;id&quot;:&quot;w&quot;,&quot;label&quot;:&quot;Batch time on X-Small (s)&quot;,&quot;expr&quot;:&quot;sum(work_xs)&quot;,&quot;fmt&quot;:&quot;i&quot;},{&quot;id&quot;:&quot;cph&quot;,&quot;label&quot;:&quot;Credits per hour at this size&quot;,&quot;expr&quot;:&quot;2^size&quot;,&quot;fmt&quot;:&quot;i&quot;,&quot;tex&quot;:&quot;\\text{credits/hour} = 2^{\\text{size}}&quot;}],&quot;row&quot;:[{&quot;id&quot;:&quot;rt&quot;,&quot;label&quot;:&quot;seconds at this size&quot;,&quot;expr&quot;:&quot;work_xs/2^(eff*size)&quot;,&quot;tex&quot;:&quot;t_i = \\frac{t_i^{XS}}{2^{\\,e\\cdot s}}&quot;}],&quot;derived&quot;:[{&quot;id&quot;:&quot;total&quot;,&quot;label&quot;:&quot;Batch run time (s)&quot;,&quot;expr&quot;:&quot;sum(rt)&quot;},{&quot;id&quot;:&quot;billed&quot;,&quot;label&quot;:&quot;Billed seconds&quot;,&quot;expr&quot;:&quot;max(60, total + suspend)&quot;,&quot;tex&quot;:&quot;t_{\\text{billed}} = \\max(60,\\; \\textstyle\\sum_i t_i + t_{\\text{suspend}})&quot;,&quot;note&quot;:&quot;per-second billing with a 60-second minimum each time the warehouse resumes&quot;},{&quot;id&quot;:&quot;credits&quot;,&quot;label&quot;:&quot;Credits used&quot;,&quot;expr&quot;:&quot;cph*billed/3600&quot;,&quot;tex&quot;:&quot;\\text{credits} = 2^{s}\\cdot \\frac{t_{\\text{billed}}}{3600}&quot;},{&quot;id&quot;:&quot;dollars&quot;,&quot;label&quot;:&quot;Cost of the refresh ($)&quot;,&quot;expr&quot;:&quot;credits*price&quot;},{&quot;id&quot;:&quot;idle&quot;,&quot;label&quot;:&quot;Share of the bill spent idle&quot;,&quot;expr&quot;:&quot;(billed - total)/billed&quot;,&quot;fmt&quot;:&quot;p&quot;},{&quot;id&quot;:&quot;speedup&quot;,&quot;label&quot;:&quot;Speed-up over X-Small&quot;,&quot;expr&quot;:&quot;w/total&quot;},{&quot;id&quot;:&quot;longest&quot;,&quot;label&quot;:&quot;Slowest query (s)&quot;,&quot;expr&quot;:&quot;amax(rt)&quot;}],&quot;chart&quot;:{&quot;title&quot;:&quot;Cost of one refresh at each warehouse size&quot;,&quot;x&quot;:{&quot;var&quot;:&quot;t&quot;,&quot;label&quot;:&quot;Warehouse size step (0 = X-Small … 7 = 4X-Large)&quot;,&quot;from&quot;:0,&quot;to&quot;:7},&quot;series&quot;:[{&quot;label&quot;:&quot;Cost with auto-suspend idle time ($)&quot;,&quot;expr&quot;:&quot;2^t*max(60, w/2^(eff*t) + suspend)/3600*price&quot;},{&quot;label&quot;:&quot;Cost if it suspended instantly ($)&quot;,&quot;expr&quot;:&quot;2^t*max(60, w/2^(eff*t))/3600*price&quot;,&quot;dash&quot;:true}],&quot;mark&quot;:&quot;size&quot;},&quot;bars&quot;:{&quot;title&quot;:&quot;Run time of each query at this size (s)&quot;,&quot;y&quot;:&quot;rt&quot;,&quot;label&quot;:&quot;query&quot;},&quot;steps&quot;:[{&quot;title&quot;:&quot;Measure the work&quot;,&quot;text&quot;:&quot;On an X-Small warehouse the twelve queries take {w} seconds back to back.&quot;,&quot;show&quot;:[&quot;w&quot;]},{&quot;title&quot;:&quot;Pick a size&quot;,&quot;text&quot;:&quot;Size step {size} costs {cph} credits per hour. Each step up doubles the hourly rate.&quot;,&quot;show&quot;:[&quot;cph&quot;]},{&quot;title&quot;:&quot;Estimate the run time&quot;,&quot;text&quot;:&quot;With scaling efficiency {eff}, every query runs {speedup} times faster; the batch now takes {total} seconds and the slowest query {longest} seconds.&quot;,&quot;show&quot;:[&quot;total&quot;,&quot;speedup&quot;,&quot;longest&quot;]},{&quot;title&quot;:&quot;Add the billing rules&quot;,&quot;text&quot;:&quot;Snowflake bills per second with a 60-second minimum per resume, and keeps billing until auto-suspend: {billed} seconds are billed, {idle:p} of them idle.&quot;,&quot;show&quot;:[&quot;billed&quot;,&quot;idle&quot;]},{&quot;title&quot;:&quot;Price the refresh&quot;,&quot;text&quot;:&quot;{credits} credits at ${price} each: this refresh costs ${dollars}.&quot;,&quot;show&quot;:[&quot;credits&quot;,&quot;dollars&quot;]}]}"><p>Interactive simulation. It needs JavaScript; the text below explains what it shows.</p></div>

## What you are looking at

The table holds a refresh of twelve dashboard queries with the time each one takes on an X-Small warehouse. The orange column shows how long each query takes at the size you pick, and the bar chart draws those times side by side so you can see which queries dominate the batch.

The main chart answers the sizing question directly. For every size from X-Small to 4X-Large it plots what one refresh costs. The solid line includes the idle time Snowflake keeps billing until auto-suspend; the dashed line is what the same refresh would cost if the warehouse stopped the moment the last query finished. The vertical marker shows your current size, and the results panel gives the run time, billed seconds, credits, dollars and the share of the bill spent idle.

## The algorithm

A Snowflake virtual warehouse is a cluster of compute that runs your queries. Its size sets two things. The credit rate doubles with every step: X-Small uses 1 credit per hour, Small 2, Medium 4, up to 128 for a 4X-Large standard warehouse. The compute doubles too, so a query that parallelises well runs roughly twice as fast one size up.

Roughly is the key word. The scaling efficiency setting says how much of that doubling a query really gets. With an efficiency of 1, each step halves the run time and the cost of the work stays the same at every size, because twice the rate for half the time is the same number of credits. Real queries scale less than that: small queries are dominated by fixed overhead, and some steps of a plan run on one node. With an efficiency of 0.85, each step up makes the query only about 1.8 times faster, so every step up makes the refresh a little more expensive.

Billing adds two rules. Snowflake bills per second, but with a minimum of 60 seconds each time a warehouse starts or resumes. And a running warehouse keeps billing until it has been idle for its auto-suspend period. The simulation adds that idle time to the run time, takes the larger of that and 60 seconds, and multiplies by the hourly credit rate.

A worked example with the defaults: the batch takes 974 seconds on X-Small. On a Medium warehouse (4 credits per hour) at 0.85 efficiency it runs in 300 seconds. With 300 seconds of auto-suspend, 600 seconds are billed, which is 0.67 credits or $2.00 at $3 per credit, and half of that bill is idle time. On X-Small the same refresh costs $1.06 but takes over 16 minutes.

## Things to try

- Set the efficiency to 1 and watch the dashed line go flat: with perfect scaling, bigger is faster at no extra cost for the work itself, until the batch is so short that the 60-second minimum makes the largest sizes dearer.
- Lower auto-suspend to 60 seconds: the idle share of the bill falls sharply, especially on large sizes.
- Find the smallest size where the slowest query finishes in under 30 seconds, a common target for interactive dashboards (with the defaults, size 5, a 2X-Large: on X-Large it still takes 30.3 seconds).
- Replace the work column with real X-Small timings from your query history and read off your own cost curve.
- Download the results CSV and compare sizes side by side in a spreadsheet.

## How it works in real systems

Teams usually size warehouses by workload: small warehouses for frequent light queries, larger ones for heavy transformations, and a separate warehouse per team so costs can be attributed. Multi-cluster warehouses add clusters for concurrency rather than speed, and query acceleration can offload parts of large scans. Resource monitors cap spending. The same trade-off exists in Databricks SQL warehouses, which are sized in T-shirt sizes billed in DBUs, and in BigQuery, where you buy slots or pay per byte scanned.

Short auto-suspend settings save money on bursty workloads, but each resume costs at least 60 seconds of credits and starts with a cold local cache, so very short settings can cost more for queries that run every few minutes.

## Sources

- [Snowflake documentation: Overview of warehouses](https://docs.snowflake.com/en/user-guide/warehouses-overview)
- [Snowflake documentation: Understanding compute cost](https://docs.snowflake.com/en/user-guide/cost-understanding-compute)
- [Snowflake documentation: Warehouse considerations](https://docs.snowflake.com/en/user-guide/warehouses-considerations)
