Skip to main content

ALTER WAREHOUSE

Introduced or updated: v1.2.687

Suspends, resumes, or modifies settings of an existing warehouse.

Syntax

-- Suspend or resume a warehouse
ALTER WAREHOUSE <warehouse_name> { SUSPEND | RESUME }

-- Modify warehouse settings
ALTER WAREHOUSE <warehouse_name>
SET [ warehouse_size = <size> ]
[ auto_suspend = <nullable_unsigned_number> ]
[ auto_resume = <bool> ]
[ max_cluster_count = <nullable_unsigned_number> ]
[ min_cluster_count = <nullable_unsigned_number> ]
[ comment = '<string_literal>' ]

ALTER WAREHOUSE <warehouse_name> SET TAG <tag_name> = '<tag_value>' [ , <tag_name> = '<tag_value>' ... ]

ALTER WAREHOUSE <warehouse_name> UNSET TAG <tag_name> [ , <tag_name> ... ]

ALTER WAREHOUSE <warehouse_name> RENAME TO <new_name>
ParameterDescription
SUSPENDImmediately suspends the warehouse.
RESUMEImmediately resumes the warehouse.
SETModifies one or more warehouse options. Unspecified fields remain unchanged.

Options

The SET clause accepts the same options as CREATE WAREHOUSE:

OptionType / ValuesDescription
WAREHOUSE_SIZEXSmall, Small, Medium, Large, XLarge, 2XLarge6XLargeChanges compute size.
AUTO_SUSPENDNULL, 0, or ≥300 secondsIdle timeout before automatic suspend. NULL disables auto-suspend.
AUTO_RESUMEBooleanControls whether incoming queries wake the warehouse automatically.
MAX_CLUSTER_COUNTNULL or non-negative integerUpper bound for auto-scaling clusters.
MIN_CLUSTER_COUNTNULL or non-negative integerLower bound for auto-scaling clusters.
COMMENTStringFree-form text description.
  • NULL is valid for numeric options to reset them to 0.
  • Supplying SET with no options raises an error.
  • SET TAG adds or updates one or more tags. Multiple tags can be set in a single statement separated by commas.
  • UNSET TAG removes one or more tags by their keys. Non-existent tag keys are silently ignored.
  • RENAME TO requires the warehouse to be suspended and uses the same naming rules as CREATE.

Examples

Suspend a warehouse:

ALTER WAREHOUSE my_wh SUSPEND;

Resume a warehouse:

ALTER WAREHOUSE my_wh RESUME;

Modify warehouse settings:

ALTER WAREHOUSE my_wh
SET warehouse_size = Large
auto_resume = TRUE
comment = 'Serving tier';

Disable auto-suspend:

ALTER WAREHOUSE my_wh SET auto_suspend = NULL;

Manage tags:

ALTER WAREHOUSE wh_hot SET TAG environment = 'production';
ALTER WAREHOUSE wh_hot SET TAG environment = 'staging', owner = 'john', cost_center = 'eng';
ALTER WAREHOUSE wh_hot UNSET TAG environment;
ALTER WAREHOUSE wh_hot UNSET TAG environment, owner, cost_center;
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today