Bird
Raised Fist0
SnowflakeHow-ToBeginner · 3 min read

How to Set Auto Suspend Warehouse in Snowflake

To set auto suspend for a Snowflake warehouse, use the ALTER WAREHOUSE command with the AUTO_SUSPEND parameter specifying the idle time in seconds. This setting automatically suspends the warehouse after the specified idle period to save costs.
📐

Syntax

The syntax to set auto suspend on a Snowflake warehouse is:

  • ALTER WAREHOUSE <warehouse_name> SET AUTO_SUSPEND = <seconds>;
  • <warehouse_name> is the name of your warehouse.
  • <seconds> is the idle time in seconds before the warehouse suspends automatically.
sql
ALTER WAREHOUSE my_warehouse SET AUTO_SUSPEND = 300;
💻

Example

This example sets the auto suspend time to 5 minutes (300 seconds) for a warehouse named my_warehouse. After 5 minutes of inactivity, the warehouse will suspend automatically.

sql
ALTER WAREHOUSE my_warehouse SET AUTO_SUSPEND = 300;
Output
Statement executed successfully.
⚠️

Common Pitfalls

Common mistakes when setting auto suspend include:

  • Setting AUTO_SUSPEND to 0 disables auto suspend, which can lead to unnecessary costs.
  • Not granting the required privileges to alter the warehouse.
  • Confusing AUTO_SUSPEND with AUTO_RESUME, which controls automatic resume behavior.
sql
/* Wrong: disables auto suspend (keeps warehouse always running) */
ALTER WAREHOUSE my_warehouse SET AUTO_SUSPEND = 0;

/* Right: sets auto suspend to 10 minutes */
ALTER WAREHOUSE my_warehouse SET AUTO_SUSPEND = 600;
📊

Quick Reference

ParameterDescriptionExample Value
AUTO_SUSPENDIdle time in seconds before warehouse suspends300
AUTO_RESUMEEnable automatic resume when queries startTRUE
WAREHOUSE_NAMEName of the warehouse to configuremy_warehouse
✅

Key Takeaways

Use ALTER WAREHOUSE with AUTO_SUSPEND to set idle time before suspension.
Set AUTO_SUSPEND to a positive number of seconds; 0 disables auto suspend.
Ensure you have the right privileges to alter the warehouse.
Auto suspend helps save costs by suspending idle warehouses automatically.