SnowPro Core Prep

Lab 14 · Domain 4 · You are Priya

Warehouses — up vs out

Read every Teach first section before you copy SQL. Lab 13 asked whether to resize. Today you learn how: scale up (bigger size) vs scale out (more clusters), plus auto-suspend/resume and statement timeout. Always leave class on cheap WH_CORE_XS.

Business problem Monday morning: twenty Kai-dashboards queue behind one heavy ETL. Morgan says “make it bigger.” Riley says “we need more warehouses.” They’re describing two different knobs — size vs clusters.
Solution you will practice Prove WH_CORE_M resize (scale up), name multi-cluster (scale out, Enterprise+), tune AUTO_SUSPEND / AUTO_RESUME, set a statement timeout, then shrink and suspend so you don’t burn credits.
Before
One confused knob
  • “Bigger” for every pain
  • Idle WH left running
  • No timeout on runaway SQL
After
Right lever for the pain
  • Up = complexity / memory
  • Out = concurrency queues
  • Suspend + timeout = FinOps

Episode 14 · Start here

Two different problems. Two different knobs.

MorganManager
One query takes forever. Make the warehouse Medium.
RileyEngineer
My problem is fifty short queries waiting in line. That’s scale out — more clusters of the same size — not always a bigger single engine.

Dev’s rule: complexity/spill → up. Queues/concurrency → out (MCW).

See it — scale UP vs scale OUT

Scale UP
Bigger warehouse size

XS → S → M → … More CPU/memory per cluster for heavy queries.

ALTER WAREHOUSE … SET WAREHOUSE_SIZE = 'MEDIUM'
Scale OUT
Multi-cluster WH

Add clusters (Enterprise+) so concurrent queries don’t queue as hard.

MIN_CLUSTER_COUNT / MAX_CLUSTER_COUNT
Idle
AUTO_SUSPEND / RESUME

Suspend after idle seconds; resume on next query. Idle burn = forgot suspend.

AUTO_SUSPEND = 60 on lab WHs
Guardrail
Statement timeout

Kill runaway statements after N seconds so one query can’t burn the day.

STATEMENT_TIMEOUT_IN_SECONDS

Flow — Alpine’s two engines

Daily WH_CORE_XS stay here after labs
Demo only WH_CORE_M resize proof → shrink
FinOps SUSPEND M USE WH_CORE_XS

Before Step 1

Sam: “Don’t leave Medium on overnight.”

SamCompliance — also watches bills
Trial credits aren’t infinite. If you CREATE OR REPLACE a huge warehouse and walk away, that’s on you.
PriyaYou
Got it — demo on WH_CORE_M, then set size back down, SUSPEND, and USE WAREHOUSE WH_CORE_XS.

1 SHOW the lab warehouses

What this does: Confirms bootstrap created both engines. You need OPERATE to resize.

SQL · show
USE ROLE ROLE_CORE_LAB_ADMIN;
SHOW WAREHOUSES LIKE 'WH_CORE%';
✓ WH_CORE_XS and WH_CORE_M listed

Before Step 2

Resizing is online

KaiAnalyst
If I resize mid-day, do I kick everyone off?
DevCoach
Resize is online. Running queries finish on the old servers; new queries pick up the new size. Exam loves that phrase.

2 Scale UP on WH_CORE_M (then shrink)

What this does: Brief Medium demo + timeout setting. Immediately return size toward cheap and suspend.

SQL · resize demo
USE WAREHOUSE WH_CORE_M;
ALTER WAREHOUSE WH_CORE_M SET WAREHOUSE_SIZE = 'MEDIUM';
ALTER WAREHOUSE WH_CORE_M SET AUTO_SUSPEND = 60;
ALTER WAREHOUSE WH_CORE_M SET AUTO_RESUME = TRUE;
ALTER WAREHOUSE WH_CORE_M SET STATEMENT_TIMEOUT_IN_SECONDS = 3600;

SELECT CURRENT_WAREHOUSE();
SQL · always leave cheap
ALTER WAREHOUSE WH_CORE_M SET WAREHOUSE_SIZE = 'XSMALL';
ALTER WAREHOUSE WH_CORE_M SUSPEND;
USE WAREHOUSE WH_CORE_XS;
SELECT CURRENT_WAREHOUSE();
✓ Active warehouse is WH_CORE_XS; M suspended

3 Multi-cluster awareness (Enterprise)

What this does: You may not be able to enable MCW on Standard trial — still memorize MIN/MAX clusters and scaling policy for the exam.

SQL · MCW (commented if blocked)
-- Enterprise+ multi-cluster (scale OUT):
-- ALTER WAREHOUSE WH_CORE_M SET
--   MIN_CLUSTER_COUNT = 1
--   MAX_CLUSTER_COUNT = 3
--   SCALING_POLICY = 'STANDARD';
--
-- STANDARD vs ECONOMY scaling policy = how eagerly new clusters spin up.
✓ You can explain MCW without leaving clusters running

Exam presses further — say these out loud

Q1. Concurrency problem vs complexity problem?

Say: Many queued short queries → scale OUT (multi-cluster). One heavy query spilling/CPU-bound → scale UP (larger size). Don’t swap them.

Q2. What do MIN/MAX cluster counts control?

Say: The floor and ceiling of how many same-size clusters a multi-cluster warehouse may run under load. Credits scale with active clusters.

Q3. Idle credit burn — what’s the fix?

Say: AUTO_SUSPEND after a short idle period, AUTO_RESUME for the next query. Leaving a large WH running with no suspend is the classic FinOps fail.

Q4. Is warehouse resizing online?

Say: Yes. In-flight queries complete on current servers; new queries use the new size. You don’t need an outage window for a resize.

Q5. Why keep WH_CORE_XS for daily labs?

Say: X-Small + 60s suspend is enough for teaching queries and minimizes accidental credit burn. Use Medium only for deliberate demos, then shrink/suspend.

Priya’s wrap-up (say this out loud)
“Scale UP changes warehouse size for heavy queries; scale OUT adds clusters for concurrency (Enterprise multi-cluster). I demoed WH_CORE_M, set suspend/resume and a statement timeout, then returned to WH_CORE_XS and suspended M. Outcome: I pick the right warehouse knob — and I don’t leave Alpine on an expensive engine.”
Next Lab 15 — QUALIFY, MERGE, UDFs/procs, and VARIANT/FLATTEN on event JSON.
← Lab 13 Lab 15 — SQL & VARIANT →