0
0
Snowflakecloud~10 mins

Multi-cluster warehouses in Snowflake - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Multi-cluster warehouses
User Query Arrives
Check Warehouse Load
Is Load High?
NoUse Single Cluster
Yes
Start Additional Clusters
Distribute Queries Across Clusters
Monitor Load and Scale Down
Return Results to User
The system checks warehouse load and adds clusters if needed to handle more queries, then scales down when load decreases.
Execution Sample
Snowflake
CREATE WAREHOUSE my_wh
  WAREHOUSE_SIZE = 'MEDIUM'
  MIN_CLUSTER_COUNT = 1
  MAX_CLUSTER_COUNT = 3;
This code creates a multi-cluster warehouse that can scale between 1 and 3 clusters based on query load.
Process Table
StepWarehouse LoadClusters ActiveAction TakenResult
1Low1Use single clusterQueries processed by 1 cluster
2Medium1Monitor loadNo change, still 1 cluster
3High1Start 2nd clusterQueries distributed between 2 clusters
4Very High2Start 3rd clusterQueries distributed among 3 clusters
5Medium3Scale down to 2 clustersOne cluster stopped, load balanced
6Low2Scale down to 1 clusterBack to single cluster
7Low1Maintain single clusterStable state
8Low1No further actionExecution ends
💡 Load is low and only 1 cluster active, no scaling needed
Status Tracker
VariableStartAfter Step 3After Step 4After Step 6Final
Warehouse LoadLowHighVery HighLowLow
Clusters Active12311
Key Moments - 3 Insights
Why does the warehouse start additional clusters only when load is high?
Because as shown in execution_table steps 3 and 4, additional clusters start only when load reaches 'High' or 'Very High' to handle more queries efficiently.
What happens when the load decreases after scaling up?
As seen in steps 5 and 6, the warehouse scales down clusters to save resources, stopping extra clusters when load is medium or low.
Can the warehouse have zero clusters active?
No, the minimum cluster count is 1, so there is always at least one cluster active, as shown in all steps of the execution_table.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, how many clusters are active at step 4?
A1
B2
C3
D4
💡 Hint
Refer to the 'Clusters Active' column at step 4 in the execution_table.
At which step does the warehouse scale down from 3 to 2 clusters?
AStep 3
BStep 5
CStep 6
DStep 7
💡 Hint
Check the 'Action Taken' column for scaling down actions in the execution_table.
If the maximum cluster count was set to 2, what would happen at step 4?
AStay at 2 clusters and distribute queries
BScale down to 1 cluster
CStart 3rd cluster anyway
DStop all clusters
💡 Hint
Look at the 'MAX_CLUSTER_COUNT' setting in the execution_sample and relate it to cluster limits.
Concept Snapshot
Multi-cluster warehouses automatically add or remove compute clusters
based on query load to improve performance and concurrency.
Set MIN_CLUSTER_COUNT and MAX_CLUSTER_COUNT to control scaling.
Queries are distributed across active clusters.
Clusters scale down when load decreases to save costs.
Full Transcript
Multi-cluster warehouses in Snowflake help handle varying query loads by automatically adding or removing compute clusters. When query load is low, a single cluster processes queries. As load increases, additional clusters start to share the work, improving speed and concurrency. When load drops, extra clusters stop to save resources. This behavior is controlled by settings like MIN_CLUSTER_COUNT and MAX_CLUSTER_COUNT. The execution table shows step-by-step how clusters start and stop based on load changes, ensuring efficient resource use and fast query processing.