0
0
Snowflakecloud~10 mins

Auto-suspend and auto-resume in Snowflake - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Auto-suspend and auto-resume
Warehouse starts
Warehouse active
No queries for X minutes?
NoKeep running
Yes
Auto-suspend warehouse
Warehouse suspended
New query arrives?
NoStay suspended
Yes
Auto-resume warehouse
Warehouse active again
The warehouse runs and processes queries. If idle for a set time, it suspends automatically. When a new query comes, it resumes automatically.
Execution Sample
Snowflake
ALTER WAREHOUSE mywh SET AUTO_SUSPEND = 5;
ALTER WAREHOUSE mywh SET AUTO_RESUME = TRUE;
This sets the warehouse to suspend after 5 minutes idle and to resume automatically on new queries.
Process Table
StepWarehouse StateIdle Time (minutes)EventAction Taken
1Running0Query executedContinue running
2Running3No queriesContinue running
3Running5No queriesAuto-suspend triggered
4SuspendedN/ANo queriesStay suspended
5SuspendedN/ANew query arrivesAuto-resume triggered
6Running0Query executedContinue running
💡 Warehouse suspends after 5 minutes idle and resumes on new query.
Status Tracker
VariableStartAfter Step 1After Step 3After Step 5Final
Warehouse StateRunningRunningSuspendedRunningRunning
Idle Time (minutes)03500
Key Moments - 2 Insights
Why does the warehouse suspend at step 3 even though it was running before?
Because the idle time reached the AUTO_SUSPEND threshold of 5 minutes as shown in execution_table row 3.
What triggers the warehouse to resume at step 5?
A new query arrives, triggering auto-resume as shown in execution_table row 5.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the warehouse state at step 4?
ARunning
BStarting
CSuspended
DStopping
💡 Hint
Check the 'Warehouse State' column at step 4 in the execution_table.
At which step does the warehouse auto-suspend due to inactivity?
AStep 2
BStep 3
CStep 5
DStep 6
💡 Hint
Look for 'Auto-suspend triggered' in the 'Action Taken' column.
If AUTO_SUSPEND was set to 10 minutes instead of 5, how would the idle time at suspension change?
AIt would suspend at 10 minutes
BIt would suspend at 5 minutes
CIt would suspend at 3 minutes
DIt would never suspend
💡 Hint
AUTO_SUSPEND controls the idle time before suspension, see variable_tracker for idle time values.
Concept Snapshot
Auto-suspend pauses a Snowflake warehouse after set idle minutes.
Auto-resume restarts it when a new query arrives.
Set AUTO_SUSPEND with minutes, AUTO_RESUME to TRUE.
Saves cost by not running idle warehouses.
Warehouse state changes: Running -> Suspended -> Running.
Full Transcript
Snowflake warehouses run to process queries. When no queries run for a set time, the warehouse auto-suspends to save resources. When a new query arrives, it auto-resumes automatically. This behavior is controlled by AUTO_SUSPEND and AUTO_RESUME settings. For example, setting AUTO_SUSPEND to 5 means the warehouse suspends after 5 minutes idle. AUTO_RESUME true means it starts again on new queries. The execution table shows the warehouse running, then suspending after 5 minutes idle, staying suspended until a new query arrives, then resuming to run again.