SHOW COMPUTE POOLS

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

Tip

You can also use the Snowflake REST APIs to perform this operation. For information, see List compute pools (REST endpoint reference).

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).

target_nodes

Indicates the number of nodes that Snowflake is targeting for your compute pool. If active_nodes is not equal to the target_nodes, then Snowflake will autoscale the cluster to add or remove the nodes.

The following examples demonstrate how to interpret the values in the target_nodes column.

Example 1: Suppose that, in a CREATE COMPUTE POOL command, you specify MIN_NODES=1 and MAX_NODES=3.

While Snowflake is provisioning a node, initially the value in the active_nodes and idle_nodes columns is 0, and the value in the target_nodes column is 1. (The value in the target_nodes column is the same as the value that you specified for the MIN_NODES parameter.) This indicates that there should be one node in the compute pool that Snowflake is provisioning.

After Snowflake provisions one node, the value in the idle_nodes column is 1 (assuming that there are no services running). The value in the target_nodes column is still 1, indicating there should be one node in the compute pool.

Example 2: Snowflake might try to add a node to an existing compute pool due to autoscaling or changes to the minimum number of nodes (through ALTER COMPUTE POOL … SET MIN_NODES).

While Snowflake is provisioning a node, the value in the state column is resizing. To determine how many nodes Snowflake is adding, check the value in the target_nodes column.

For example, suppose that the value in the, active_nodes column is 1, the value in the idle_nodes column is 0, and you resize the compute pool by updating the MIN_NODES property from 1 to 2. In this case, the value in the target_nodes column is 2 (the number of nodes that should be in the compute pool). From this, you can infer that Snowflake is provisioning one additional node.

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.

is_exclusive

true if the compute pool is created exclusively for a Snowflake Native App; false otherwise.

application

Name of the Snowflake Native App if the compute pool is created exclusively for the app. Otherwise, NULL.

budget

The name of the budget monitoring the credit usage of 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 | target_nodes | created_on                    | resumed_on                    | updated_on                    | owner        | comment | is_exclusive | application | budget |
|-------------------------+-----------+-----------+-----------+-----------------+--------------+----------+-------------------+-------------+--------------+------------+--------------+-------------------------------+-------------------------------+-------------------------------+--------------+---------+--------------+-------------+--------|
| TUTORIAL_COMPUTE_POOL   | ACTIVE    |         1 |         1 | CPU_X64_XS      |            3 |        0 |              3600 | true        |            1 |          0 |            1 | 2024-02-24 20:41:31.978 -0800 | 2024-08-08 11:27:01.775 -0700 | 2024-08-18 13:47:08.150 -0700 | TEST_ROLE    | NULL    | false        | NULL        | NULL   |
| TUTORIAL_COMPUTE_POOL_2 | SUSPENDED |         1 |         1 | CPU_X64_XS      |            0 |        0 |              3600 | true        |            0 |          0 |            0 | 2024-01-15 21:23:09.744 -0800 | 2024-04-06 15:24:50.541 -0700 | 2024-08-18 13:46:08.110 -0700 | ACCOUNTADMIN | NULL    | false        | NULL        | NULL   |
+-------------------------+-----------+-----------+-----------+-----------------+--------------+----------+-------------------+-------------+--------------+------------+--------------+-------------------------------+-------------------------------+-------------------------------+--------------+---------+--------------+-------------+--------+
Language: English