Pillar 3 — Elimination
Principle: The cheapest query is the one you never run. Before optimizing work, remove the work that shouldn't happen at all.
Elimination is the highest-leverage pillar and the first two steps of the optimization hierarchy — suspend and cache. Eliminating a query beats optimizing it every time: a rewrite makes a query 20% cheaper; a cache hit makes it free.
Why it matters
Two forms of pure waste dominate most Snowflake bills:
- Idle warehouse time — a warehouse left running with no queries still bills credits. Many warehouses are idle the majority of the day.
- Repeated identical work — dashboards, scheduled jobs, and CI re-run the same deterministic queries, each one resuming a warehouse and paying again for an answer that hasn't changed.
What to eliminate
| Waste | Lever | chukei mechanism |
|---|---|---|
| Idle warehouses | aggressive auto-suspend | suspend plugin |
| Repeated deterministic reads | result caching | verified cache |
| Concurrent identical queries (dashboard herds) | request coalescing | coalescing |
SELECT * scanning all columns | column pruning rewrite | rewrite plugin |
Do / don't
| Do | Don't |
|---|---|
| Suspend idle warehouses aggressively (resume is fast) | Leave warehouses running "to avoid resume latency" |
| Cache deterministic reads across users and tools | Cache anything with RANDOM()/timestamps/writes |
| Collapse concurrent identical queries | Let a dashboard refresh wake a warehouse N times |
| Verify cache correctness continuously | Trust a cache you can't audit |
How chukei enforces it — safely
Elimination sounds risky ("what if the cache is wrong?"), so chukei makes it safe by construction. The cache is false-positive-intolerant: non-deterministic queries and writes are never cached, writes invalidate affected entries, and blame mode continuously re-checks a sample of cache hits against live Snowflake (measured record: 60,000 hits, 0 mismatches). If anything is uncertain, chukei fails open and runs the query normally.
Elimination checklist
- Idle warehouses auto-suspend on a short timeout.
- Deterministic reads are served from a verified cache.
- Concurrent identical queries are coalesced into one execution.
- Cache correctness is verified continuously, not assumed.
-
SELECT *over wide tables is flagged or rewritten.
Related
- Previous: Attribution · Next: Efficiency
- Snowflake query caching guide
- Request coalescing
Size the waste first. The
replay simulator reports how much of your
QUERY_HISTORY is cacheable and how much warehouse time is idle.