CREATE INTERACTIVE WAREHOUSE

statementsupportedAccounts, users, sessions, warehouses

docs.snowflake.com ↗

Object: INTERACTIVE WAREHOUSE

Creates 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

NameRequiredDescription
nameSpecifies 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.
  • table_name — Specifies the identifier for an interactive table to associate with the warehouse. You can specify multiple table names separated by commas. Note All specified tables must be interactive tables created with the INTERACTIVE keyword. If this clause is omitted, you can associate interactive tables later using ALTER WAREHOUSE with the ADD TABLES clause. You can attach up to 100 tables to an interactive warehouse. Cache warming may take significant time depending on the size of the data.
WAREHOUSE_SIZE = string_constantSpecifies 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 = numSpecifies 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 = numSpecifies 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_nameSpecifies 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_nameSpecifies 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 = numSpecifies the concurrency level for SQL statements executed by the interactive warehouse cluster.
STATEMENT_QUEUED_TIMEOUT_IN_SECONDS = numSpecifies the time, in seconds, a SQL statement can be queued before being canceled.
STATEMENT_TIMEOUT_IN_SECONDS = numSpecifies 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

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.

See also