Module 16 · Lesson 2 of 10Detailed study · about 22 min

Right-size a warehouse and set auto-suspend

Compare warehouse size, execution time, queues, multi-cluster usage and idle time. Use the 60-second billing minimum to choose a cost-effective configuration.

Compare the time the compute is running

Maple Market must finish its nightly orders job in 120 seconds. It takes 180 seconds on X-Small and 80 seconds on Small. A larger warehouse spends credits faster, yet it can spend fewer credits in total when it finishes enough sooner.

For a Gen1 standard warehouse, X-Small uses 1 credit per running hour per cluster and Small uses 2. For one uninterrupted interval at a fixed size, estimate credits as hourly rate × billed seconds ÷ 3,600. Snowflake bills at least 60 seconds when compute is provisioned, then by the second. Idle time while compute stays running counts in the interval. Use measured metering for resizes, additional clusters and other warehouse types or generations.

Same output, two single-cluster benchmark runs
WarehouseRunning timeEstimated credits120-second deadline
Gen1 X-Small180 seconds0.050000Misses
Gen1 Small80 seconds0.044444Meets

Choose auto-suspend around the gaps between jobs

Auto-suspend stops a standard warehouse after it has been idle for the configured interval. Auto-resume lets the next statement that needs the warehouse start it again. A short idle setting generally helps isolated jobs. For frequent bursts, repeated restarts can trigger more minimums, increase startup waiting and lose the local warehouse cache. Snowflake checks eligibility periodically, so the setting is an approximate idle target.

Imagine two 20-second jobs with a 25-second gap. With compute staying up and stopping immediately after the second job, the interval is 65 seconds. If each job starts a fully stopped warehouse and compute is stopped immediately after each, the two starts bill 120 seconds total. These are simplified timing boundaries. In practice count the post-job idle window, observe whether suspension actually occurred and measure restart delay.

Inspect the gaps in the actual workload before changing the setting. Compare a morning dashboard with dense bursts to an overnight load followed by hours of silence. Schedule a rollback to the prior setting if freshness or interactive response suffers.

Choose more compute for the problem you see

If a query spends most of its time waiting for other work, a larger cluster can leave the concurrency problem intact. Check queue time and consider separating workloads or adding clusters for overlap. Multi-cluster warehouses require Enterprise Edition or higher. Two Small Gen1 clusters running for half an hour at the same time consume about 2 compute credits in total.

If a single query is spilling heavily or reading far more data than it needs, inspect Query Profile first. Tune the query or test a size change for that one job. Use the same inputs, validate output, record queue and run time, and compare repeated runs with similar cache conditions. Share the deadline and criteria before picking the winner.

Price one cluster, then price overlapping clusters

One cluster is a set of compute resources. Scale up by changing its size to give a query more resources. Scale out by adding clusters at the configured size so more queries can run concurrently. A second cluster does not combine its memory with the first to speed up one query. Check memory spill on the slow query and overload time for competing queries.

These are example rates for Gen1 standard compute per cluster, in credits per running hour. An isolated Large run taking 55 seconds bills at least 60. At 8 credits per hour it costs 0.133333 credits. It becomes cheaper than an isolated X-Small only if X-Small takes more than 480 seconds, under these assumptions. An X-Small run taking 600 seconds costs 0.166667. Recheck the published rate for your warehouse generation, type and region.

Gen1 standard examples per cluster
SizeCredits/hourExample fresh intervalEstimated credits
X-Small1600 seconds0.166667
Small280 seconds0.044444
Medium490 seconds0.100000
Large855 seconds → 60 billed0.133333
Two ways to add warehouse capacity Test one resize for spill or slow execution. Test extra clusters when users chiefly wait for a turn.
  1. Query History and ProfileCompare when execution or spill dominates to One larger cluster
  2. Query History and ProfileCompare when overload queues dominate to More clusters of the same size
  3. One larger clusterCount billed running seconds to Credits per successful workload
  4. More clusters of the same sizeSum each cluster’s billed seconds to Credits per successful workload

Run a size or auto-suspend comparison on an isolated warehouse

Use a role with CREATE WAREHOUSE, a disposable schema with SELECT on an approved, fixed benchmark input, and an approved cost allowance. The example takes the read-only benchmark and schema as parameters. Use a realistic input for performance. Run the same workload and compare ordered output or keys and totals before comparing duration. Close other clients using the test warehouse.

A warm warehouse can reuse locally cached table data. USE_CACHED_RESULT = FALSE only prevents reuse of a persisted query result. For a cold comparison, suspend between trials and verify complete suspension. For a warm comparison, use the same repeat cadence. Compare queuing for overload with provisioning delay, execution time and bytes spilled. Track the whole warehouse billing interval, including the idle tail.

Create the pilot and record the candidate configuration

Create one Gen1 standard X-Small warehouse. The idle setting is in seconds and suspension is checked periodically. Run the annotated benchmark once before and once after the size change. After both runs, capture completed query IDs and inspect Query History. Stop the warehouse between the two cold runs.

SQL · configuration template
CREATE WAREHOUSE M16D_BENCH_WH
  WAREHOUSE_TYPE = 'STANDARD' WAREHOUSE_SIZE = 'XSMALL' GENERATION = '1'
  AUTO_SUSPEND = 60 AUTO_RESUME = TRUE INITIALLY_SUSPENDED = TRUE;
USE WAREHOUSE M16D_BENCH_WH;
ALTER SESSION SET USE_CACHED_RESULT = FALSE;
ALTER SESSION SET QUERY_TAG = 'M16D|XS|COLD';
SELECT store_id, SUM(amount) AS sales
FROM <LAB_DB>.<LAB_SCHEMA>.<BENCHMARK_ORDERS> GROUP BY store_id ORDER BY store_id;
ALTER WAREHOUSE M16D_BENCH_WH SUSPEND;
-- Confirm suspension before changing size and running again.
SHOW WAREHOUSES LIKE 'M16D_BENCH_WH';
ALTER WAREHOUSE M16D_BENCH_WH SET WAREHOUSE_SIZE = 'SMALL';
ALTER SESSION SET QUERY_TAG = 'M16D|S|COLD';
SELECT store_id, SUM(amount) AS sales
FROM <LAB_DB>.<LAB_SCHEMA>.<BENCHMARK_ORDERS> GROUP BY store_id ORDER BY store_id;
ALTER WAREHOUSE M16D_BENCH_WH SUSPEND;

Test concurrency separately and clean up

For a separate Enterprise Edition or higher concurrency trial, test simultaneous sessions on the same Small warehouse before and after changing the maximum cluster count. STANDARD can start additional clusters as demand rises. ECONOMY prioritizes credit conservation and can allow more queueing. Two Small clusters running for 30 and 15 minutes cost 1.5 credits in this illustrative schedule. Inspect total cluster time, P95 wait and successful requests. To test only suspend behavior, leave size and concurrency fixed and compare a 60-second setting with a longer idle window.

Change only the setting under test. End the test by suspending and dropping the disposable warehouse. Close the fresh worksheet so its cache and tag settings do not carry into other work.

SQL · configuration template
-- Optional multi-cluster trial on the disposable Small warehouse.
ALTER WAREHOUSE M16D_BENCH_WH SET MIN_CLUSTER_COUNT = 1 MAX_CLUSTER_COUNT = 2
  SCALING_POLICY = 'STANDARD';
SHOW WAREHOUSES LIKE 'M16D_BENCH_WH';
-- Example alternative, run in a separate trial with one cluster.
ALTER WAREHOUSE M16D_BENCH_WH SET MAX_CLUSTER_COUNT = 1 AUTO_SUSPEND = 120;
-- Run only after the trials and after recording IDs and settings.
DROP WAREHOUSE M16D_BENCH_WH;

Explain the decision in an interview

Start with the rule, then say what you would check in a real account.

When can a larger warehouse be cheaper?

When the complete billed interval shrinks enough to offset the higher rate. I count the minimum, idle tail and extra clusters, then check that the output and completion target still hold.

Should a warehouse suspend between every request?

I compare the savings in the gap with a fresh start, its billing minimum, startup time and lost local cache. Short dashboard bursts and nightly batches can justify different settings.

How do you decide between scale-up and scale-out?

I look for slow execution or spill in an individual query versus time waiting for other queries. That tells me which experiment to run.

Words used in this lesson
Auto-suspend
Stops a standard warehouse after its configured idle interval.
Auto-resume
Starts a suspended standard warehouse when work needs it.
Multi-cluster warehouse
Additional clusters can serve overlapping queries at the configured size.

See how it works

Choose a step to explore the idea at your own pace.

Open the interactive explanation
Interactive explainer1 / 2

Right-size a warehouse and set auto-suspend

Stopped
Provision compute
60-second minimum

Start a stopped warehouse

Each fresh start provisions compute and begins with a 60-second billing minimum.

Automatic playback is off for reduced motion. Select any step or use Previous and Next. Illustrations explain behavior; they are not live measurements.

Read the complete diagram explanation
  1. Start a stopped warehouse

    Each fresh start provisions compute and begins with a 60-second billing minimum.

    Stopped → Provision compute → 60-second minimum

  2. Watch the gap

    An active warehouse spends credits during idle time. Suspending can save a long gap and introduces a fresh start on subsequent work.

    Run query → Idle window → Suspend or reuse

Try the SQL or command

Read → predict → run in your learning environment → compare. You can also learn by reading without an account.

New to SQL? Where to run it and how to read it

A query is a question written in SQL. Snowflake runs it and returns a result table. This website shows examples; it does not connect to your account.

  1. No account yet? Read and predict the output first. Follow the account and Snowsight lesson when you are ready.
  2. For SQL practice, use a learning account in Snowsight and select an authorized role and warehouse. A role determines permissions; a warehouse supplies processing power. Follow the example’s database/schema setup when it refers to stored objects.
  3. Read the entire example, including comments beginning with --. Run the selected statement or labeled block in the stated order. Examples labeled Python, shell or HTTP belong in that client, not in a SQL editor.
  4. Compare values and row counts with the explained result. If an example deliberately causes an error, follow its rollback and cleanup steps before continuing.
SELECT / FROM
Choose the values to return / identify their input.
VALUES / COLUMN1
VALUES supplies tiny example rows. COLUMN1 means their first column, COLUMN2 their second.
AS / WITH
AS gives a result a readable name. WITH names a temporary query step within one statement.
NULL / ::
NULL means missing or unknown. The :: notation converts a value to a named data type.
Session
One connection and its settings. Keep related transaction steps in the same session.
Database.schema.table
A full address for stored data. It is separate from the warehouse that processes queries.

Need the L2_OBJECTS_LAB setup? Open the first database-object lesson →

Help with common practice errors
  • No active warehouse: select a warehouse your role can use. Do not assume you need to create a new one.
  • Object missing or not authorized: check the full name, required setup and active role. Ask the account owner for access if needed.
  • Object already exists: setup may already have run. Read the current state or choose a fresh lab name consistently; do not add OR REPLACE blindly.
  • Different result: check whether an earlier INSERT or UPDATE changed the data. VALUES examples provide their own fresh input for each statement.

Compare two sizes and a quick restart

SQL · runnable example
WITH trials AS (
  SELECT column1 AS warehouse_run, column2 AS credits_per_hour, column3 AS running_seconds
  FROM VALUES ('A X-Small batch', 1, 180),
              ('B Small batch', 2, 80),
              ('C Small short job', 2, 20)
)
SELECT warehouse_run,
       GREATEST(running_seconds, 60) AS billed_seconds,
       ROUND(credits_per_hour * GREATEST(running_seconds, 60) / 3600, 6) AS estimated_credits
FROM trials
ORDER BY warehouse_run;

What to expect and why

Each input row is one fresh compute interval at one size. GREATEST puts a one-minute floor under each run. The short job illustrates the minimum and belongs to a different workload from the two batch trials.

Expected result for the supplied input (not live output)
WAREHOUSE_RUNBILLED_SECONDSESTIMATED_CREDITS
A X-Small batch1800.050000
B Small batch800.044444
C Small short job600.033333

Inspect warehouse settings before proposing a change

SQL · runnable example
SHOW WAREHOUSES LIKE 'ORDERS%';

What to expect and why

Use the name prefix for your approved warehouse. Look at size, auto_suspend, auto_resume, min_cluster_count and max_cluster_count. The account returns only visible matching warehouses. A configuration change belongs in an approved maintenance window with the prior value recorded.

Check your understanding

Choose an answer, then check your reasoning. This is practice, not a scored test.

How many seconds are billed for a standalone 20-second interval on a freshly provisioned Small Gen1 cluster?

Try it yourself

At what running time would Small tie an X-Small run of 180 seconds, using the sample rates?

Compare your reasoning

90 seconds on Small uses 2 × 90 ÷ 3,600 = 0.05 credits. Both intervals are above the minimum.

Connect this lesson to the learning path

Official sources and curriculum

Module 16 · See module scope

By Rohit Ray · Independent educational lesson · Explore this visual lab