Pillar 4 — Efficiency
Principle: Once you've eliminated the work that shouldn't run, make the work that remains as cheap as possible — right-size first, rewrite second.
Efficiency is steps three and four of the optimization hierarchy — size then rewrite. It comes after elimination on purpose: there's no point tuning a query you could have cached, or right-sizing a warehouse you could have suspended.
Why it matters
Snowflake warehouse sizes double in credit rate at each step. Running an X-Large where a Small would do is a 16× multiplier on every query in that warehouse — so right-sizing is the highest-multiplier efficiency lever, ahead of any single-query rewrite.
Warehouse size → credit rate
| Size | Credits / hour | Relative cost |
|---|---|---|
| X-Small | 1 | 1× |
| Small | 2 | 2× |
| Medium | 4 | 4× |
| Large | 8 | 8× |
| X-Large | 16 | 16× |
| 2X-Large | 32 | 32× |
| 3X-Large | 64 | 64× |
| 4X-Large | 128 | 128× |
Billing is per-second with a 60-second minimum on resume. The practical implications — and how to pick a size from query shape rather than guesswork — are in the warehouse management guide.
The two efficiency levers
| Lever | When it wins | chukei mechanism |
|---|---|---|
| Right-sizing | warehouse is over- or under-provisioned for its workload | warehouse sizing / bandit (SetWarehouseSize) |
| Query rewriting | the query itself scans or computes more than it needs | deterministic rewrite rules |
chukei's rewrite rules are equivalence-tested,
not LLM-guesses: eliminate SELECT *, push predicates, use
APPROX_COUNT_DISTINCT where exactness isn't required, convert OR chains to
IN, hoist constants. Every rule ships with positive and negative tests so it
never fires when it would change a result.
Efficiency checklist
- Warehouse sizes are chosen from workload data, not habit.
- Over-provisioned warehouses are downsized.
-
SELECT *and missing predicates are rewritten or flagged. - Rewrites are equivalence-tested before they're trusted.
- The 60-second resume minimum is accounted for in scheduling.
Related
- Previous: Elimination · Next: Governance
- Snowflake warehouse management guide
- The plugin bus — how rewrites are applied
Find the right size from your own data. The
replay simulator models warehouse
right-sizing against your real QUERY_HISTORY.