CREATE INTERACTIVE WAREHOUSE
statementsupportedAccounts, users, sessions, warehousesCreates a new interactive virtual warehouse optimized for low-latency, high-concurrency workloads with interactive tables. Interactive warehouses are designed to deliver optimal query performance when working with interactive tables, which provide fast query responses for frequently accessed data through intelligent caching and optimization. This feature is generally available in select Amazon Web Services (AWS), Google Cloud Platform (GCP), and Microsoft Azure regions only. For details, see Region availability.
Syntax
supportedpartialnot supportednot scored
CREATE [ OR REPLACE ] INTERACTIVE WAREHOUSE [ IF NOT EXISTS ] <name>
[ TABLES ( <table_name> [ , <table_name> ... ] ) ]
[ [ WITH ] objectProperties ]
[ [ WITH ] TAG ( <tag_name> = '<tag_value>' [ , <tag_name> = '<tag_value>' , ... ] ) ]
[ objectParams ]
Where
objectProperties ::=
WAREHOUSE_SIZE = { XSMALL | SMALL | MEDIUM | LARGE | XLARGE | XXLARGE | XXXLARGE | X4LARGE }
MAX_CLUSTER_COUNT = <num>
MIN_CLUSTER_COUNT = <num>
AUTO_SUSPEND = { <num> | NULL }
AUTO_RESUME = { TRUE | FALSE }
INITIALLY_SUSPENDED = { TRUE | FALSE }
RESOURCE_MONITOR = <monitor_name>
FALLBACK_WAREHOUSE = <warehouse_name>
COMMENT = '<string_literal>'
Where
objectParams ::=
MAX_CONCURRENCY_LEVEL = <num>
STATEMENT_QUEUED_TIMEOUT_IN_SECONDS = <num>
STATEMENT_TIMEOUT_IN_SECONDS = <num>
Parameters
| Name | Required | Description |
|---|---|---|
name | Specifies the identifier for the interactive warehouse. The identifier must be unique within your account. For more details, see Identifier requirements. | |
TABLES ( ... ) | Optionally specifies a comma-separated list of interactive table names to immediately associate with the interactive warehouse. Using this clause starts the cache-warming process for the specified tables when the warehouse is created.
| |
WAREHOUSE_SIZE = string_constant | Specifies the size of the interactive warehouse. Interactive warehouses support specific sizes optimized for interactive workloads. Valid values: XSMALL , 'X-SMALL' SMALL MEDIUM LARGE XLARGE , 'X-LARGE' XXLARGE , X2LARGE , '2X-LARGE' XXXLARGE , X3LARGE , '3X-LARGE' X4LARGE , '4X-LARGE' Default: XSMALL Note To use a value that contains a hyphen (for example, '2X-LARGE'), you must enclose the value in single quotes, as shown. Choose a warehouse size to match your workload requirements. You can adjust the MIN_CLUSTER_COUNT and MAX_CLUSTER_COUNT properties to optimize for concurrency. | |
MAX_CLUSTER_COUNT = num | Specifies the maximum number of clusters for a multi-cluster interactive warehouse. Valid values: 1 to 10 (depending on warehouse size) Default: 1 (single-cluster warehouse) | |
MIN_CLUSTER_COUNT = num | Specifies the minimum number of clusters for a multi-cluster interactive warehouse. Valid values: 1 to the value of MAX_CLUSTER_COUNT Default: 1 | |
AUTO_SUSPEND = { num | NULL } | Specifies the number of seconds of inactivity after which the interactive warehouse is automatically suspended. The minimum value for interactive warehouses is 3600 (1 hour). Specifying a lower value returns an error. Setting the value to NULL disables auto-suspend. Default: NULL (auto-suspend is disabled) | |
AUTO_RESUME = { TRUE | FALSE } | Specifies whether to automatically resume the interactive warehouse when a SQL statement is submitted to it. Default: FALSE | |
INITIALLY_SUSPENDED = { TRUE | FALSE } | Specifies whether the interactive warehouse is created in a suspended state. Default: FALSE | |
RESOURCE_MONITOR = monitor_name | Specifies the identifier of a resource monitor to assign to the interactive warehouse for credit usage control. Valid values: Any existing resource monitor Default: No value (no resource monitor assigned) | |
FALLBACK_WAREHOUSE = warehouse_name | Specifies the identifier of a standard warehouse to use as a fallback warehouse. When a query exceeds the statement timeout on the interactive warehouse, Snowflake automatically re-runs the query on the fallback warehouse. This fallback behavior is transparent to the client that issues the query. The fallback warehouse must be a standard warehouse, and can be shared with non-interactive workloads. Choose a warehouse size that is the same as or larger than the interactive warehouse. For more information, see Automatically handling statement timeouts. Default: No value (no fallback warehouse assigned) | |
COMMENT = 'string_literal' | Specifies a comment for the interactive warehouse. | |
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. | |
MAX_CONCURRENCY_LEVEL = num | Specifies the concurrency level for SQL statements executed by the interactive warehouse cluster. | |
STATEMENT_QUEUED_TIMEOUT_IN_SECONDS = num | Specifies the time, in seconds, a SQL statement can be queued before being canceled. | |
STATEMENT_TIMEOUT_IN_SECONDS = num | Specifies the time, in seconds, after which a running SQL statement is canceled. Interactive warehouses have a maximum timeout interval of five seconds. If you specify a value greater than five seconds, Snowflake caps the timeout at five seconds. For example, if you set STATEMENT_TIMEOUT_IN_SECONDS = 30, Snowflake uses the value 5. |
Usage notes
- The OR REPLACE and IF NOT EXISTS clauses are mutually exclusive. They can’t both be used in the same statement.
- CREATE OR REPLACE <object> statements are atomic. That is, when an object is replaced, the old object is deleted and the new object is created in a single transaction.
- Interactive warehouses are created in a running state by default. To create a warehouse in a suspended state, set INITIALLY_SUSPENDED = TRUE.
- When you specify the TABLES clause, cache warming begins immediately for the specified interactive tables. This process may take significant time depending on data size.
- Interactive warehouses can query any table type (standard tables, Iceberg tables, dynamic tables, and interactive tables) directly, without copying or transforming data. For more information, see .
- Interactive warehouses support auto-suspend and auto-resume. The minimum AUTO_SUSPEND value is 3600 seconds (1 hour). For more information, see Resuming and suspending an interactive warehouse.
- Interactive warehouses support multi-cluster configuration for handling high-concurrency workloads.
- If you don’t specify the TABLES clause during creation, you can associate interactive tables later using ALTER WAREHOUSE with the ADD TABLES clause.
- You can configure a fallback warehouse to automatically re-run queries that exceed the statement timeout on an interactive warehouse. Set the fallback warehouse with ALTER WAREHOUSE. For more information, see Automatically handling statement timeouts.
- 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.
Access control requirements
A role used to execute this SQL command must have at least one of the following privileges at a minimum: Privilege | Object | Notes CREATE WAREHOUSE | Account | Required to create any warehouse, including interactive warehouses. USAGE | Interactive Table | Required on each interactive table specified in the TABLES clause, if used. 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.
Billing and pricing
For information about billing and pricing considerations for interactive warehouses, see Cost and billing considerations.