CREATE COMPUTE POOL

Creates a new compute pool in the current account.

See also:

ALTER COMPUTE POOL , DESCRIBE COMPUTE POOL, DROP COMPUTE POOL , SHOW COMPUTE POOLS

Syntax

CREATE COMPUTE POOL [ IF NOT EXISTS ] <name>
  [ FOR APPLICATION <app-name> ]
  MIN_NODES = <num>
  MAX_NODES = <num>
  INSTANCE_FAMILY = <instance_family_name>
  [ AUTO_RESUME = { TRUE | FALSE } ]
  [ INITIALLY_SUSPENDED = { TRUE | FALSE } ]
  [ AUTO_SUSPEND_SECS = <num>  ]
  [ [ WITH ] TAG ( <tag_name> = '<tag_value>' [ , <tag_name> = '<tag_value>' , ... ] ) ]
  [ COMMENT = '<string_literal>' ]
  [ PLACEMENT_GROUP = '<placement_group_name>' ]

Required parameters

name

String that specifies the identifier (that is, the name) for the compute pool; it must be unique for your account. Quoted names for special characters or case-sensitive names are not supported.

MIN_NODES = num

Specifies the minimum number of nodes for the compute pool. This value must be greater than 0. For more information, see Creating a compute pool.

MAX_NODES = num

Specifies the maximum number of nodes for the compute pool.

INSTANCE_FAMILY = instance_family_name

Identifies the type of machine you want to provision for the nodes in the compute pool. The machine type determines the amount of compute resources in the compute pool and, therefore, the number of credits consumed while the compute pool is running.

For a complete list of available instance families organized by cloud provider, see Instance Families. You can also use SHOW COMPUTE POOL INSTANCE FAMILIES to retrieve current availability and specifications programmatically.

Optional parameters

FOR APPLICATION app_name

Specifies the Snowflake Native App name. If specified, the compute pool can only be used by the native app. The SHOW COMPUTE POOLS command output includes the is_exclusive and application columns to indicate whether the compute pool is created exclusively for an app and provides the app name.

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 RESUME) before you can start a service or job on the compute pool.

  • If AUTO_RESUME is TRUE, if you start a new service on a suspended compute pool, Snowflake starts the compute pool. Similarly, when you use a service either by invoking a service function or accessing ingress (see Using a service), Snowflake starts the previously suspended compute pool and resumes the service.

Default: TRUE

INITIALLY_SUSPENDED = { TRUE | FALSE }

Specifies whether the compute pool is created initially in the suspended state. If you create a compute pool with INITIALLY_SUSPENDED set to TRUE, Snowflake will not provision any nodes requested for the compute pool at the compute pool creation time. You can start the suspended compute pool using ALTER COMPUTE POOL … RESUME.

Default: FALSE

AUTO_SUSPEND_SECS = num

Number of seconds of inactivity after which you want Snowflake to automatically suspend the compute pool. An inactive compute pool is one in which no services or jobs are currently active on any node in the pool. If auto_suspend_secs is set to 0, Snowflake does not suspend the compute pool automatically.

Default: 3600 seconds

TAG tag_name = 'tag_value' [ , tag_name = 'tag_value' , ... ]

Specifies the tag name and the tag string value.

The tag value is always a string, and the maximum number of characters for the tag value is 256.

For information about specifying tags in a statement, see Tag quotas.

COMMENT = 'string_literal'

Specifies a comment for the compute pool.

Default: No value

PLACEMENT_GROUP = placement_group_name

Identifies the placement group of the compute pool. Use the SHOW COMPUTE POOLS and DESCRIBE COMPUTE POOL commands to review the assignment of the compute pool into placement groups.

You can also set placement_group to DISTRIBUTED. In this case, Snowflake attempts to distribute compute pool nodes across all available placement groups to maintain an even distribution across multiple placement groups so that the groups are more fault tolerant. For more information, see Compute pool placement.

Access control requirements

A role used to execute this operation must have the following privileges at a minimum:

Privilege

Object

Notes

CREATE COMPUTE POOL

Account

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

Create a 1-node compute pool. This example command specifies the minimum required parameters:

CREATE COMPUTE POOL tutorial_compute_pool
  MIN_NODES = 1
  MAX_NODES = 1
  INSTANCE_FAMILY = CPU_X64_XS;

The following command specifies the optional AUTO_RESUME parameter:

CREATE COMPUTE POOL tutorial_compute_pool
  MIN_NODES = 1
  MAX_NODES = 1
  INSTANCE_FAMILY = CPU_X64_XS
  AUTO_RESUME = FALSE;