Snowflake generation 2 standard warehouses¶
Generation 2 Standard Warehouse (Gen2) is an updated version (the “next generation”) of the current standard virtual warehouse in Snowflake, focused on improving performance for analytics and data engineering workloads. Gen2 is built on top of faster underlying hardware and intelligent software optimizations, such as enhancements to delete, update, and merge operations, and table scan operations. With Gen2, you can expect the majority of queries finish faster, and you can do more work at the same time. The exact details depend on your configuration and workload. Conduct tests to verify how much this feature improves your costs, performance, or both.
You can specify the RESOURCE_CONSTRAINT clause in the CREATE WAREHOUSE or ALTER WAREHOUSE commands for standard warehouses, using one of the following values:
STANDARD_GEN_1 represents Snowflake’s original, industry-leading standard virtual warehouses.
STANDARD_GEN_2 represents the next generation of Snowflake’s standard virtual warehouses.
Note
Currently, the STANDARD_GEN_1 and STANDARD_GEN_2 values aren’t available in Snowsight. You must specify them with SQL commands.
Generation 2 standard warehouses aren’t available for warehouse sizes X5LARGE and X6LARGE.
This feature applies to standard warehouses. It doesn’t apply to Snowpark-optimized warehouses.
STANDARD_GEN_1 provides the same memory capacity for standard warehouses as MEMORY_1X does for Snowpark-optimized warehouses.
Default value for the RESOURCE_CONSTRAINT for standard warehouses¶
If you don’t specify the RESOURCE_CONSTRAINT clause when you create a standard warehouse, Snowflake creates a generation 1 standard warehouse.
Changing a warehouse to or from a generation 2 warehouse¶
You can alter a standard warehouse and specify a different RESOURCE_CONSTRAINT clause to change it from generation 1 to generation 2, or from generation 2 to generation 1. You must suspend the warehouse before doing so.
You can also switch between a generation 2 standard warehouse and a Snowpark-optimized warehouse by changing the value of the WAREHOUSE_TYPE and RESOURCE_CONSTRAINT clauses. That change also requires suspending the warehouse first.
You can see the setting for a standard warehouse in the "resource_constraint"
column of
the SHOW WAREHOUSES output.
This setting isn’t reflected in the INFORMATION_SCHEMA views for warehouses.
Region availability¶
This feature is available for the Amazon Web Services (AWS) and Microsoft Azure cloud service providers. It isn’t currently available for Google Cloud Platform (GCP).
Generation 2 standard warehouses are available in the following regions.
AWS us-west-2 (Oregon)
AWS eu-central-1 (Frankfurt)
Azure East US 2 (Virginia)
Azure West Europe (Netherlands)
Important
If you use account replication for your warehouses, and you create any generation 2 warehouses, any secondary regions must also have generation 2 warehouse support. Otherwise, the generation 2 warehouses might not be able to resume in the secondary regions after a failover. Make sure to test that any generation 2 warehouses can be resumed in secondary regions.
Cost and billing for generation 2 standard warehouses¶
For general information about credit usage with Snowflake virtual warehouses, see Virtual warehouse credit usage.
For information about credit consumption for generation 2 standard warehouses, see the Snowflake Service Consumption Table.
Examples¶
The following examples show how you can specify generation 2 standard warehouses when creating a new warehouse or altering an existing one. The examples show variations such as changing the warehouse size, type, and memory capacity at the same time.
The following example creates a generation 2 warehouse with all other properties left as defaults. The warehouse type is STANDARD and the size is XSMALL. Those defaults are the same for both generation 1 and generation 2 standard warehouses.
CREATE OR REPLACE WAREHOUSE next_generation_default_size
RESOURCE_CONSTRAINT = STANDARD_GEN_2;
The following example creates a generation 2 standard warehouse with size SMALL.
CREATE OR REPLACE WAREHOUSE next_generation_size_small
RESOURCE_CONSTRAINT = STANDARD_GEN_2
WAREHOUSE_SIZE = SMALL;
The following example shows how to convert a generation 1 standard warehouse to generation 2. The warehouse size remains the same, XLARGE, throughout the operation.
CREATE OR REPLACE WAREHOUSE old_to_new_xlarge
WAREHOUSE_SIZE = XLARGE;
ALTER WAREHOUSE old_to_new_xlarge SUSPEND;
ALTER WAREHOUSE old_to_new_xlarge
SET RESOURCE_CONSTRAINT = STANDARD_GEN_2;
ALTER WAREHOUSE old_to_new_xlarge RESUME;
The following example shows how to convert a generation 2 standard warehouse to Snowpark-optimized. Snowpark-optimized warehouses currently aren’t available as generation 2 warehouses. Because the warehouse has size XSMALL when it has the type STANDARD, we specify a RESOURCE_CONSTRAINT value of MEMORY_1X. That RESOURCE_CONSTRAINT produces a memory size that’s compatible with Snowpark-optimized warehouses of XSMALL size.
CREATE OR REPLACE WAREHOUSE gen2_to_snowpark_optimized
RESOURCE_CONSTRAINT = STANDARD_GEN_2;
ALTER WAREHOUSE gen2_to_snowpark_optimized SUSPEND;
ALTER WAREHOUSE gen2_to_snowpark_optimized
SET WAREHOUSE_TYPE = 'SNOWPARK-OPTIMIZED' RESOURCE_CONSTRAINT = MEMORY_1X;
ALTER WAREHOUSE gen2_to_snowpark_optimized RESUME;
The following example shows how to convert a Snowpark-optimized warehouse to a standard generation 2 warehouse. The Snowpark-optimized warehouse starts with size MEDIUM and a relatively large memory capacity represented by a RESOURCE_CONSTRAINT value of MEMORY_16X. After the change, the warehouse is of type STANDARD, still with size MEDIUM. However, its memory capacity is lower. That’s because the RESOURCE_CONSTRAINT value of STANDARD_GEN_2 has the same memory capacity as a Snowpark-optimized warehouse with a resource constraint of MEMORY_1X.
CREATE OR REPLACE WAREHOUSE snowpark_optimized_medium_to_gen2
WAREHOUSE_TYPE = 'SNOWPARK-OPTIMIZED'
WAREHOUSE_SIZE = MEDIUM
RESOURCE_CONSTRAINT = MEMORY_16X;
ALTER WAREHOUSE snowpark_optimized_medium_to_gen2 SUSPEND;
ALTER WAREHOUSE snowpark_optimized_medium_to_gen2
SET WAREHOUSE_TYPE = STANDARD RESOURCE_CONSTRAINT = STANDARD_GEN_2;
ALTER WAREHOUSE snowpark_optimized_medium_to_gen2 RESUME;