Anavsan Explore

Terminology › Cost mechanics

What is Snowflake query spillage?

Query spillage is a memory symptom with a credit consequence. The query still completes. The warehouse simply stays billed longer. Recurring remote spills are a workload-governance issue, not a Query Profile curiosity.

Snowflake query spillage occurs when an operation creates more intermediate data than the virtual warehouse can hold in memory. Snowflake writes that data to local disk, and if necessary to remote cloud storage. Execution slows. Credits accrue against the extra runtime. Spillage does not appear as a line item on the bill.

Key takeaways

Runtime is the cost surface. Warehouses consume credits while they run. Spillage extends elapsed time. Extra minutes on a large warehouse move the invoice.
Remote usually costs more than local. Remote spillage is typically the more severe performance degradation because intermediate data moves through cloud storage.
Frequency turns a spill into a pattern. A one-off analyst spill is noise. An hourly dbt model that spills to remote storage is a credit object.
Resize is not governance. A larger warehouse can finish in memory and still raise spend. Reduce the working set first; prove total credits, not Query Profile alone.

How spillage turns into Snowflake credits

Most efficient queries complete in memory. Joins, sorts, aggregations, window functions, and large scans can manufacture a working set the warehouse cannot hold. Local spillage adds disk I/O. Remote spillage is slower still. If the spilling query is the last work on the warehouse, it can delay auto-suspend. If it shares a warehouse, it can keep compute up for everyone else or push concurrent queries into queueing.

Useful metrics: bytes_spilled_to_local_storage, bytes_spilled_to_remote_storage, execution time, run frequency, and warehouse size. Query Profile shows which operators produced the intermediate data. The cost explainer is How Query Spillage Increases Snowflake Costs.

Local vs remote

Local spillageRemote spillage
WhereDisk attached to the warehouseCloud storage beyond local capacity
Typical impactSlower than memoryMore severe degradation
PriorityWatch if recurringHighest-cost candidate when recurring on large or shared warehouses

Why detecting spillage is only half the problem

Finding spilled bytes does not assign an owner, choose among rewrite, resize, reroute, or accept, or prove credits fell. Warehouse resizing without that context can raise consumption. That is workload governance: Trace → Assign → Prove → Enforce. The companion argument is detection is only half the problem.

What to do

Prioritize remote, recurring spills on larger or shared warehouses. Reduce the working set: filter earlier, drop unused columns, fix exploding joins, avoid over-wide aggregations. Then match warehouse size to the job and measure total credits. On Anavsan, those rows belong on the Enforcement Desk with an owner — not only in Query Profile.

Frequently asked questions

When a query cannot keep intermediate results in warehouse memory, Snowflake writes them to local disk or remote storage. The query still completes; runtime and credits usually increase.
It can. Credits accrue while the warehouse runs. Spillage typically extends execution and can delay auto-suspend or block other work on a shared warehouse.
Usually yes. Remote spillage generally produces more severe performance degradation, so recurring remote spills on larger warehouses are the highest-cost candidates.
No. First reduce unnecessary intermediate data. Resize when the workload is genuinely memory intensive. Prove the change in total credits, not only in a faster Query Profile.