What if your cloud warehouse could save money and work for you without any manual steps?
Why Auto-suspend and auto-resume in Snowflake? - Purpose & Use Cases
Imagine you have a warehouse in Snowflake that you need to start and stop manually every time you run a query or load data.
You have to remember to suspend it when done to avoid extra costs.
Manually starting and stopping warehouses is slow and easy to forget.
If you forget to suspend, you keep paying for compute even when not using it.
This wastes money and causes stress about cloud bills.
Auto-suspend and auto-resume automatically pause the warehouse when idle and restart it when needed.
This saves money without you lifting a finger.
You get fast query performance and cost control together.
ALTER WAREHOUSE mywh RESUME; -- run queries ALTER WAREHOUSE mywh SUSPEND;
CREATE WAREHOUSE mywh WITH AUTO_SUSPEND = 300 AUTO_RESUME = TRUE;You can focus on your data work while Snowflake manages compute costs smartly in the background.
A data analyst runs reports during the day and stops at night.
With auto-suspend and auto-resume, the warehouse pauses after inactivity and restarts instantly when the analyst runs new queries.
Manual warehouse control wastes time and money.
Auto-suspend pauses compute automatically after inactivity.
Auto-resume restarts compute instantly when needed.
Practice
auto-suspend feature in a Snowflake warehouse?Solution
Step 1: Understand auto-suspend functionality
Auto-suspend stops the warehouse when it is idle for a set time to avoid unnecessary charges.Step 2: Differentiate from auto-resume
Auto-resume starts the warehouse when a query runs, not auto-suspend.Final Answer:
To automatically stop the warehouse after a period of inactivity to save costs -> Option CQuick Check:
Auto-suspend = stops warehouse after inactivity [OK]
- Confusing auto-suspend with auto-resume
- Thinking auto-suspend increases warehouse size
- Assuming auto-suspend backs up data
Solution
Step 1: Recall correct syntax for enabling auto-resume
The correct command uses ALTER WAREHOUSE with SET AUTO_RESUME = TRUE.Step 2: Eliminate incorrect options
ALTER WAREHOUSE my_wh SET AUTO_SUSPEND = TRUE; sets auto_suspend, not auto_resume. CREATE WAREHOUSE my_wh AUTO_RESUME = ON; uses wrong syntax for CREATE. ALTER WAREHOUSE my_wh ENABLE AUTO_RESUME; uses invalid command.Final Answer:
ALTER WAREHOUSE my_wh SET AUTO_RESUME = TRUE; -> Option AQuick Check:
Enable auto-resume with SET AUTO_RESUME = TRUE [OK]
- Confusing AUTO_RESUME with AUTO_SUSPEND
- Using CREATE instead of ALTER for existing warehouse
- Using invalid commands like ENABLE AUTO_RESUME
ALTER WAREHOUSE my_wh SET AUTO_SUSPEND = 300; ALTER WAREHOUSE my_wh SET AUTO_RESUME = TRUE; -- Warehouse is currently suspended SELECT CURRENT_WAREHOUSE();
What happens when the SELECT query runs?
Solution
Step 1: Understand auto-resume behavior
With AUTO_RESUME = TRUE, the warehouse starts automatically when a query runs.Step 2: Apply to the SELECT query
The warehouse is suspended but will resume automatically before executing the SELECT.Final Answer:
The warehouse automatically resumes and the query runs successfully -> Option AQuick Check:
Auto-resume starts warehouse on query run [OK]
- Assuming query fails if warehouse is suspended
- Thinking warehouse stays suspended during query
- Believing query returns NULL when warehouse resumes
AUTO_SUSPEND = 0 and AUTO_RESUME = TRUE on a warehouse. What issue might occur?Solution
Step 1: Understand AUTO_SUSPEND = 0 meaning
Setting AUTO_SUSPEND to 0 disables auto-suspend, so warehouse stays running.Step 2: Consider AUTO_RESUME effect
AUTO_RESUME = TRUE allows auto-start but does not suspend warehouse automatically.Final Answer:
The warehouse never suspends, causing continuous charges -> Option DQuick Check:
AUTO_SUSPEND=0 disables suspend, warehouse runs always [OK]
- Thinking AUTO_SUSPEND=0 suspends immediately
- Assuming warehouse suspends after default time
- Believing warehouse cycles suspend/resume every second
Solution
Step 1: Choose auto-suspend time for 5 minutes
5 minutes equals 300 seconds, so AUTO_SUSPEND = 300 is correct.Step 2: Enable auto-resume for automatic start
Setting AUTO_RESUME = TRUE ensures warehouse starts when queries run.Final Answer:
Set AUTO_SUSPEND = 300 and AUTO_RESUME = TRUE -> Option BQuick Check:
5 min suspend + auto-resume = AUTO_SUSPEND=300 & AUTO_RESUME=TRUE [OK]
- Using 0 for AUTO_SUSPEND disables suspend
- Disabling AUTO_RESUME causes manual start
- Setting suspend time too short or too long
Ready to prove it?
Pass the test and this pattern moves unknown
