SHOW COMPUTE POOLS

Lists the compute pools in your account for which you have access privileges.

See also:

CREATE COMPUTE POOL , ALTER COMPUTE POOL, DESCRIBE COMPUTE POOL , DROP COMPUTE POOL

Syntax

SHOW COMPUTE POOLS [ LIKE '<pattern>' ]
                   [ STARTS WITH '<name_string>' ]
                   [ LIMIT <ROWS> [ FROM '<name-string>' ] ]
Copy

Parameters

LIKE 'pattern'

Optionally filters the command output by object name. The filter uses case-insensitive pattern matching, with support for SQL wildcard characters (% and _).

For example, the following patterns return the same results:

... LIKE '%testing%' ...
... LIKE '%TESTING%' ...

. Default: No value (no filtering is applied to the output).

STARTS WITH 'name_string'

Optionally filters the command output based on the characters that appear at the beginning of the object name. The string must be enclosed in single quotes and is case-sensitive.

For example, the following strings return different results:

... STARTS WITH 'B' ...
... STARTS WITH 'b' ...

. Default: No value (no filtering is applied to the output)

LIMIT rows [ FROM 'name_string' ]

Optionally limits the maximum number of rows returned, while also enabling “pagination” of the results. The actual number of rows returned might be less than the specified limit. For example, the number of existing objects is less than the specified limit.

The optional FROM 'name_string' subclause effectively serves as a “cursor” for the results. This enables fetching the specified number of rows following the first row whose object name matches the specified string:

  • The string must be enclosed in single quotes and is case-sensitive.

  • The string does not have to include the full object name; partial names are supported.

Default: No value (no limit is applied to the output)

Note

For SHOW commands that support both the FROM 'name_string' and STARTS WITH 'name_string' clauses, you can combine both of these clauses in the same statement. However, both conditions must be met or they cancel out each other and no results are returned.

In addition, objects are returned in lexicographic order by name, so FROM 'name_string' only returns rows with a higher lexicographic value than the rows returned by STARTS WITH 'name_string'.

For example:

  • ... STARTS WITH 'A' LIMIT ... FROM 'B' would return no results.

  • ... STARTS WITH 'B' LIMIT ... FROM 'A' would return no results.

  • ... STARTS WITH 'A' LIMIT ... FROM 'AB' would return results (if any rows match the input strings).

Access control requirements

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

Privilege

Object

Notes

Any one of these privileges: OWNERSHIP, USAGE, MONITOR, or OPERATE

Compute pool

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.

Output

The command output provides compute pool properties and metadata in the following columns:

Column

Description

name

Compute pool name.

state

State of the compute pool. For more information, see Compute pool lifecycle.

min_nodes

Minimum number of nodes in the compute pool.

max_nodes

Maximum number of nodes in the compute pool.

instance_family

Machine type of nodes in the compute pool.

num_services

Number of services running on the compute pool.

num_jobs

Number of jobs running on the compute pool.

auto_suspend_secs

Number of seconds of inactivity after which Snowflake automatically suspends the compute pool.

auto_resume

Whether to automatically resume a compute pool when Snowflake starts a service or job.

active_nodes

Number of nodes in the compute pool that are active (one or more services or jobs are running).

idle_nodes

Number of nodes in the compute pool that are idle (no service or job is running).

created_on

Date and time when the compute pool was created.

resumed_on

Date and time when the suspended compute pool was resumed.

updated_on

Date and time when the compute pool was updated using ALTER COMPUTE POOL.

owner

Role that owns the compute pool.

comment

Specifies a comment for the compute pool.

Usage notes

  • Columns that start with the prefix is_ return either Y (yes) or N (no).

  • The command does not require a running warehouse to execute.

  • The command returns a maximum of 10K records for the specified object type, as dictated by the access privileges for the role used to execute the command; any records above the 10K limit are not returned, even with a filter applied.

    To view results for which more than 10K records exist, query the corresponding view (if one exists) in the Snowflake Information Schema.

  • To post-process the output of this command, you can use the RESULT_SCAN function, which treats the output as a table that can be queried.

Examples

The following command lists the compute pools for which you have access privileges in the current account:

SHOW COMPUTE POOLS;
Copy

The following command lists one compute pool:

SHOW COMPUTE POOLS LIMIT 1;
Copy

The following command lists compute pools with names containing “tu”:

SHOW COMPUTE POOLS LIKE '%tu%';
Copy

The following command lists two compute pools with names containing “my_pool”:

SHOW COMPUTE POOLS LIKE '%my_pool%' LIMIT 2;
Copy

Sample output:

+-----------------------+--------+-----------+-----------+-----------------+--------------+----------+------------------+-------------+--------------+------------+-------------------------------+-------------------------------+-------------------------------+--------------+---------+
| name                  | state  | min_nodes | max_nodes | instance_family | num_services | num_jobs |auto_suspend_secs | auto_resume | active_nodes | idle_nodes | created_on                    | resumed_on                    | updated_on                    | owner        | comment |
|-----------------------+--------+-----------+-----------+-----------------+--------------+----------+------------------+-------------+--------------+------------+-------------------------------+-------------------------------+-------------------------------+--------------+---------|
| TUTORIAL_COMPUTE_POOL | ACTIVE |         1 |         1 | CPU_X64_XS      |            3 |        1 |                0 | false       |            1 |          0 | 2023-04-09 11:20:36.824 -0700 | 2023-04-09 11:20:36.818 -0700 | 2023-05-26 19:59:31.228 -0700 | ACCOUNTADMIN | NULL    |
+-----------------------+--------+-----------+-----------+-----------------+--------------+----------+------------------+-------------+--------------+------------+-------------------------------+-------------------------------+-------------------------------+--------------+---------+