Why Virtual Warehouses Control Compute Independently
📖 Scenario: You are working with Snowflake, a cloud data platform. Snowflake uses virtual warehouses to run queries and process data. Each virtual warehouse controls its own compute resources independently. This helps manage workloads efficiently.
🎯 Goal: Build a simple Snowflake setup that shows how to create multiple virtual warehouses with independent compute settings.
📋 What You'll Learn
Create a virtual warehouse named WH_SMALL with size SMALL
Create a virtual warehouse named WH_LARGE with size LARGE
Set the auto-suspend time to 300 seconds for both warehouses
Set the auto-resume feature to true for both warehouses
💡 Why This Matters
🌍 Real World
Virtual warehouses let companies run many data queries at once without waiting. Each warehouse can be sized and paused independently to save money and speed up work.
💼 Career
Cloud engineers and data analysts use virtual warehouses to optimize data processing and control costs in Snowflake environments.
Progress0 / 4 steps
1
Create the first virtual warehouse
Write a Snowflake SQL command to create a virtual warehouse called WH_SMALL with size SMALL.
Snowflake
Hint
Use CREATE WAREHOUSE followed by the warehouse name and size.
2
Create the second virtual warehouse
Write a Snowflake SQL command to create a virtual warehouse called WH_LARGE with size LARGE.
Snowflake
Hint
Repeat the create warehouse command with the new name and size.
3
Set auto-suspend for both warehouses
Write Snowflake SQL commands to set the auto-suspend time to 300 seconds for both WH_SMALL and WH_LARGE warehouses.
Snowflake
Hint
Use ALTER WAREHOUSE to change settings after creation.
4
Enable auto-resume for both warehouses
Write Snowflake SQL commands to enable auto-resume for both WH_SMALL and WH_LARGE warehouses.
Snowflake
Hint
Use ALTER WAREHOUSE to enable auto-resume by setting it to TRUE.
Practice
(1/5)
1. Why do virtual warehouses in Snowflake control compute independently?
easy
A. To share compute resources evenly among all users
B. To allow multiple workloads to run without affecting each other
C. To reduce storage costs by combining compute
D. To limit the number of queries that can run simultaneously
Solution
Step 1: Understand the role of virtual warehouses
Virtual warehouses provide compute resources for queries and run independently.
Step 2: Identify the benefit of independent control
Independent control prevents one workload from slowing down others by isolating compute resources.
Final Answer:
To allow multiple workloads to run without affecting each other -> Option B
Quick Check:
Independent compute control = no workload interference [OK]
Hint: Think: separate engines run separately to avoid slowdowns [OK]
Common Mistakes:
Confusing compute independence with storage sharing
Assuming warehouses share compute resources
Thinking compute control reduces storage costs
2. Which of the following is the correct way to suspend a virtual warehouse in Snowflake?
easy
A. ALTER WAREHOUSE my_wh SUSPEND;
B. SUSPEND WAREHOUSE my_wh;
C. ALTER WAREHOUSE my_wh SET SUSPEND = TRUE;
D. ALTER WAREHOUSE my_wh SUSPEND IMMEDIATE;
Solution
Step 1: Recall Snowflake syntax for suspending warehouses
The correct command uses ALTER WAREHOUSE with SUSPEND.
Step 2: Check each option's syntax
Invalid syntax includes extra keywords like IMMEDIATE, missing ALTER, or incorrect SET usage. The correct syntax is ALTER WAREHOUSE my_wh SUSPEND;.
Final Answer:
ALTER WAREHOUSE my_wh SUSPEND; -> Option A
Quick Check:
Correct suspend syntax = ALTER WAREHOUSE ... SUSPEND [OK]
Hint: Remember: ALTER WAREHOUSE ... SUSPEND is correct [OK]
Common Mistakes:
Using SUSPEND without ALTER WAREHOUSE
Trying to set SUSPEND as a property
Using unnecessary keywords like IMMEDIATE
3. Given two virtual warehouses, WH1 and WH2, running queries simultaneously, what happens if WH1 is resized larger while WH2 continues running?
medium
A. WH2's compute resources are reduced automatically
B. Both warehouses share the new combined compute power
C. WH1's resize does not affect WH2's compute resources
D. WH2 is suspended until WH1 finishes resizing
Solution
Step 1: Understand independent compute control
Each warehouse controls its own compute resources independently.
Step 2: Analyze the effect of resizing one warehouse
Resizing WH1 affects only WH1; WH2 continues unaffected.
Final Answer:
WH1's resize does not affect WH2's compute resources -> Option C
Quick Check:
Independent compute means resizing one doesn't impact others [OK]
Hint: Resize affects only targeted warehouse, others run normally [OK]
Common Mistakes:
Assuming compute resources are shared dynamically
Thinking resizing pauses other warehouses
Believing compute is pooled automatically
4. You tried to resume a suspended warehouse with the command RESUME WAREHOUSE my_wh; but got an error. What is the likely cause?
medium
A. The correct command is ALTER WAREHOUSE my_wh RESUME;
B. Warehouse names cannot contain underscores
C. You must use ALTER WAREHOUSE my_wh RESUME WAREHOUSE;
D. The warehouse is already running and cannot be resumed
Solution
Step 1: Check Snowflake syntax for resuming warehouses
The correct command uses ALTER WAREHOUSE with RESUME keyword.
Step 2: Identify the error in the given command
RESUME WAREHOUSE alone is invalid; must use ALTER WAREHOUSE my_wh RESUME;
Final Answer:
The correct command is ALTER WAREHOUSE my_wh RESUME; -> Option A
Quick Check:
Resume warehouse syntax = ALTER WAREHOUSE ... RESUME [OK]
Hint: Use ALTER WAREHOUSE ... RESUME to restart suspended warehouse [OK]
Common Mistakes:
Using RESUME WAREHOUSE alone as a command
Misnaming warehouses with invalid characters
Trying to resume an already running warehouse
5. You have three virtual warehouses: WH_A, WH_B, and WH_C. WH_A is running a heavy ETL job, WH_B is idle, and WH_C runs light queries. To optimize costs and performance, which approach best uses independent compute control?
hard
A. Suspend WH_A and WH_C, run all queries on WH_B
B. Resize all warehouses to the same size to balance compute
C. Merge all warehouses into one to share compute and reduce costs
D. Resize WH_A larger, suspend WH_B, and keep WH_C small and running
Solution
Step 1: Use independent compute control to match workload needs
Resize WH_A larger for heavy ETL, suspend idle WH_B to save costs, keep WH_C small for light queries.
Step 2: Avoid resizing all equally or merging warehouses
Balancing sizes wastes resources; merging loses independent control benefits.
Final Answer:
Resize WH_A larger, suspend WH_B, and keep WH_C small and running -> Option D
Quick Check:
Match warehouse size to workload independently for best cost/performance [OK]
Hint: Adjust each warehouse size and state based on its workload [OK]
Common Mistakes:
Making all warehouses the same size regardless of workload
Suspending warehouses that are actively needed
Trying to merge warehouses to save costs
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.