SHOW COMPUTE POOLS¶
Lists the compute pools in your account for which you have access privileges.
Syntax¶
SHOW COMPUTE POOLS [ LIKE '<pattern>' ]
[ STARTS WITH '<name_string>' ]
[ LIMIT <ROWS> [ FROM '<name-string>' ] ]
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'
andSTARTS 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 bySTARTS 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 |
---|---|
|
Compute pool name. |
|
State of the compute pool. For more information, see Compute pool lifecycle. |
|
Minimum number of nodes in the compute pool. |
|
Maximum number of nodes in the compute pool. |
|
Machine type of nodes in the compute pool. |
|
Number of services running on the compute pool. |
|
Number of jobs running on the compute pool. |
|
Number of seconds of inactivity after which Snowflake automatically suspends the compute pool. |
|
Whether to automatically resume a compute pool when Snowflake starts a service or job. |
|
Number of nodes in the compute pool that are active (one or more services or jobs are running). |
|
Number of nodes in the compute pool that are idle (no service or job is running). |
|
Indicates the number of nodes that Snowflake is targeting for your compute pool. If The following examples demonstrate how to interpret the values in the 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 After Snowflake provisions one node, the value in the 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 For example, suppose that the value in the, |
|
Date and time when the compute pool was created. |
|
Date and time when the suspended compute pool was resumed. |
|
Date and time when the compute pool was updated using ALTER COMPUTE POOL. |
|
Role that owns the compute pool. |
|
Specifies a comment for the compute pool. |
|
|
|
Name of the Snowflake Native App if the compute pool is created exclusively for the app. Otherwise, NULL. |
|
The name of the budget monitoring the credit usage of the compute pool. |
Usage notes¶
Columns that start with the prefix
is_
return eitherY
(yes) orN
(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;
The following command lists one compute pool:
SHOW COMPUTE POOLS LIMIT 1;
The following command lists compute pools with names containing “tu”:
SHOW COMPUTE POOLS LIKE '%tu%';
The following command lists two compute pools with names containing “my_pool”:
SHOW COMPUTE POOLS LIKE '%my_pool%' LIMIT 2;
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 |
+-------------------------+-----------+-----------+-----------+-----------------+--------------+----------+-------------------+-------------+--------------+------------+--------------+-------------------------------+-------------------------------+-------------------------------+--------------+---------+--------------+-------------+--------+