ALTER COMPUTE POOL¶
Modifies the properties of an existing compute pool.
Syntax¶
ALTER COMPUTE POOL [ IF EXISTS ] <name> { SUSPEND | RESUME }
ALTER COMPUTE POOL [ IF EXISTS ] <name> STOP ALL;
ALTER COMPUTE POOL [ IF EXISTS ] <name> SET [ MIN_NODES = <num> ]
[ MAX_NODES = <num> ]
[ AUTO_RESUME = { TRUE | FALSE } ]
[ AUTO_SUSPEND_SECS = <num> ]
[ COMMENT = '<string_literal>' ]
ALTER COMPUTE POOL [ IF EXISTS ] <name> UNSET { AUTO_SUSPEND_SECS |
AUTO_RESUME |
COMMENT
}
[ , ... ]
Parameters¶
name
Specifies the identifier for the compute pool to alter.
If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.
For more information, see Identifier requirements.
{ SUSPEND | RESUME }
Suspends a compute pool or resumes a previously suspended compute pool. When you suspend a compute pool, Snowflake suspends all services in that compute pool, but the jobs continue to run until they reach a terminal state (DONE or FAILED), after which the compute pool nodes are released.
STOP ALL
Drops all services and cancels jobs executing in the compute pool. Snowflake then removes all the containers from the compute pool.
SET ...
Sets one or more specified properties or parameters for the compute pool:
MIN_NODES = num
Specifies the minimum number of compute pool nodes.
MAX_NODES = num
Specifies the maximum number of compute pool nodes.
AUTO_RESUME = { TRUE | FALSE }
Specifies whether to automatically resume a compute pool when a service or job is submitted to it. If AUTO_RESUME is FALSE, you need to explicitly resume the compute pool (using ALTER COMPUTE POOL <name> RESUME) before you can start a service or job on the compute pool.
AUTO_SUSPEND_SECS = num
Number of seconds of inactivity after which you want Snowflake to automatically suspend the compute pool. Inactivity means no services and no jobs running on any node in the compute pool.
COMMENT = 'string_literal'
Specifies a comment for the compute pool.
UNSET ...
Specifies one (or more) properties and/or parameters to unset for the compute pool, which resets them to the defaults (see CREATE COMPUTE POOL):
AUTO_SUSPEND_SECS
AUTO_RESUME
COMMENT
Access control requirements¶
A role used to execute this SQL command must have the following privileges at a minimum:
Privilege |
Object |
Notes |
---|---|---|
OPERATE |
Compute pool |
To suspend or resume a compute pool, the role requires these permissions. |
MODIFY |
Compute pool |
To alter the compute pool and set properties, the role requires this permission. |
For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.
For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.
Usage notes¶
Regarding metadata:
Attention
Customers should ensure that no personal data (other than for a User object), sensitive data, export-controlled data, or other regulated data is entered as metadata when using the Snowflake service. For more information, see Metadata fields in Snowflake.
Examples¶
The following example sets the MAX_NODES and AUTO_RESUME properties for a compute pool:
ALTER COMPUTE POOL tutorial_compute_pool SET
MAX_NODES = 5
AUTO_RESUME = FALSE