Module 16 · Lesson 9 of 10Detailed study · about 18 min

Troubleshoot an unexpected Snowflake cost increase

Compare complete periods, identify the largest billed change, trace it to a workload and plan a measurable correction with a rollback.

Check the alert and its comparison window

Maple Market’s Monday alert shows a steep increase. Before changing infrastructure, confirm that the alert refers to the right account and unit. A partial weekend, a pricing change and a full production Monday can look like one incident when the scope is unclear.

In Snowsight, open Admin, Cost management, then Consumption with an authorized role. Use the same UTC date range and scope in your queries. Compare complete periods with similar business volume and schedules. A chosen two-day comparison can illustrate a change. A reliable production baseline often uses comparable weekdays and enough history to show normal variation.

Decide whether the change is currency, billed credits, storage or transfer volume. If currency rises and credits hold steady, ask the billing owner about rate, region or service mix. If used credits rise and billed credits hold steady, inspect the Cloud Services adjustment before reporting a billed overage. Recent records can be incomplete.

Ask the owner what changed after you find the service

Rank services by the difference in billed credits, then drill into the largest positive change. A warehouse increase can follow longer runtimes, waiting jobs, more clusters, extra starts or idle compute. A maintenance or ingestion increase can follow larger input, more changes, reruns or a recent feature rollout.

Look for a dated event that explains the change. Compare the same query, job or service before and after it. Write down evidence for the hypothesis and evidence that could disprove it. If a deployment and a spike happen together, use usage and execution records to see which part of the workload changed.

Choose a small next action with a named owner and a rollback. After the change, compare the same days and volumes. Record credits per successful run, freshness and correctness alongside the total. Keep monitoring storage or transfer if those were part of the incident.

Turn the alert into an incident with an owner

Use an approved cost-reader role and analysis warehouse. Confirm the account, credit or currency unit, and exact UTC window in the alert. Compare the same weekday and business output. Use billed daily metering for credit changes. If the billing owner sees only a currency increase, compare rates and the storage and transfer statements before diagnosing warehouse compute.

For a warehouse increase, divide the change into attributed work and idle using the same hourly rows. Compare overload queue time, provisioning delay, spill and bytes scanned for the same job family. A high queue can reflect concurrency. Spilling can reflect memory pressure or a large intermediate join. Inspect Query Profile to test that hypothesis. For a serverless increase, drill into the service’s resource and compare input and outcomes.

Sample clues that lead to different actions
EvidenceNext checkFirst controlled action
4 → 8 warehouse compute credits, idle 1 → 3Suspension history and gaps between successful jobsTry a shorter idle tail on the same workload.
Remote spill grows and queued overload stays lowJoin row growth and scan pruning in Query ProfileCorrect an inefficient query or test one size up.
Many sessions queue while execution is steadyConcurrent load and cluster scheduleSeparate workloads or pilot scale-out if supported.
Clustering 1 → 2, warehouse unchangedChanged table, clustering version and backfill timeReview the clustering benefit and maintenance window.
Daily stage bytes rise while billed compute is steadyStage ownership, age and replay requirementsReview staged file retention with its owner.

Compare compute, attribution and idle by complete day

Replace the two-day window and warehouse ID with the incident’s values. Warehouse ID avoids mixing a dropped and recreated warehouse with the same name. NULL protects the idle estimate when some attribution is missing. A representative result of 4/3/1 followed by 8/5/3 says idle and attributed work each explain two credits of the increase.

SQL · configuration template
ALTER SESSION SET TIMEZONE = 'UTC';
SELECT TO_DATE(start_time) AS utc_day,
       SUM(credits_used_compute) AS compute_credits,
       SUM(credits_attributed_compute_queries) AS attributed_credits,
       CASE WHEN COUNT(credits_attributed_compute_queries) = COUNT(*)
            THEN SUM(credits_used_compute - credits_attributed_compute_queries) END AS idle_credits
FROM SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY
WHERE warehouse_id = <approved_warehouse_id>
  AND start_time >= '2026-10-12'::DATE AND start_time < '2026-10-14'::DATE
GROUP BY utc_day ORDER BY utc_day;

Find whether demand, queues or spilling changed

Use a stable tag or a known query family and replace the warehouse and dates. One group per day and tag keeps the comparison scoped. Median execution and overload are milliseconds. SUM of remote spill is bytes across those queries. Filter or report failures separately if the job retries. Use the query IDs in Query Profile before calling a larger warehouse the remedy.

SQL · configuration template
ALTER SESSION SET TIMEZONE = 'UTC';
SELECT TO_DATE(start_time) AS utc_day, query_tag, COUNT(*) AS recorded_queries,
       MEDIAN(execution_time) AS execution_p50_ms,
       MEDIAN(queued_overload_time) AS overload_p50_ms,
       SUM(bytes_spilled_to_remote_storage) AS remote_spill_bytes
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY
WHERE warehouse_name = 'ORDERS_ELT'
  AND start_time >= '2026-10-12'::DATE AND start_time < '2026-10-14'::DATE
GROUP BY utc_day, query_tag ORDER BY utc_day, recorded_queries DESC;

Write one hypothesis that a second engineer can test

Write down the dated setting change and which hours are consistent with longer idle. If idle was already high before the setting changed, keep looking. Record the candidate, output and timing requirements, and the exact rollback. Recheck usage once the relevant history arrives. Report estimated savings separately from actual metering.

Explain the decision in an interview

Start with the rule, then say what you would check in a real account.

What is your first step after a cost alert?

I confirm the account, dates and units, then rank services by the billed change. I drill into the top service instead of assuming every increase came from a warehouse.

What if queries are faster but warehouse compute is unchanged?

I would look at running time, idle and other users’ work. Faster queries can free capacity while the warehouse stays up. I would measure the total and report the latency gain separately.

How would you test whether a deployment caused the spike?

I would line up the deployment with the changed resource and compare normalized usage over comparable periods. If the increase began before the change, that hypothesis needs another explanation.

Words used in this lesson
Baseline
A previous comparable period used for a measurement.
Cost anomaly
An unexpected usage change worth investigating.
Normalized cost
Usage divided by a useful workload unit, such as credits per successful batch.

See how it works

Choose a step to explore the idea at your own pace.

Open the interactive explanation
Interactive explainer1 / 3

Troubleshoot an unexpected Snowflake cost increase

Account and UTC
Comparable periods
Billed units

Define the comparison

Pick equivalent completed periods, a single account and one billing unit.

Automatic playback is off for reduced motion. Select any step or use Previous and Next. Illustrations explain behavior; they are not live measurements.

Read the complete diagram explanation
  1. Define the comparison

    Pick equivalent completed periods, a single account and one billing unit.

    Account and UTC → Comparable periods → Billed units

  2. Trace the leading change

    Find the service, drill to the resource and connect the change to a dated event.

    Largest change → Resource or workload → Evidence

  3. Prove a correction

    Make one approved change and compare correctness, delivery and cost.

    Owner and rollback → Controlled change → Verification

Try the SQL or command

Read → predict → run in your learning environment → compare. You can also learn by reading without an account.

New to SQL? Where to run it and how to read it

A query is a question written in SQL. Snowflake runs it and returns a result table. This website shows examples; it does not connect to your account.

  1. No account yet? Read and predict the output first. Follow the account and Snowsight lesson when you are ready.
  2. For SQL practice, use a learning account in Snowsight and select an authorized role and warehouse. A role determines permissions; a warehouse supplies processing power. Follow the example’s database/schema setup when it refers to stored objects.
  3. Read the entire example, including comments beginning with --. Run the selected statement or labeled block in the stated order. Examples labeled Python, shell or HTTP belong in that client, not in a SQL editor.
  4. Compare values and row counts with the explained result. If an example deliberately causes an error, follow its rollback and cleanup steps before continuing.
SELECT / FROM
Choose the values to return / identify their input.
VALUES / COLUMN1
VALUES supplies tiny example rows. COLUMN1 means their first column, COLUMN2 their second.
AS / WITH
AS gives a result a readable name. WITH names a temporary query step within one statement.
NULL / ::
NULL means missing or unknown. The :: notation converts a value to a named data type.
Session
One connection and its settings. Keep related transaction steps in the same session.
Database.schema.table
A full address for stored data. It is separate from the warehouse that processes queries.

Need the L2_OBJECTS_LAB setup? Open the first database-object lesson →

Help with common practice errors
  • No active warehouse: select a warehouse your role can use. Do not assume you need to create a new one.
  • Object missing or not authorized: check the full name, required setup and active role. Ask the account owner for access if needed.
  • Object already exists: setup may already have run. Read the current state or choose a fresh lab name consistently; do not add OR REPLACE blindly.
  • Different result: check whether an earlier INSERT or UPDATE changed the data. VALUES examples provide their own fresh input for each statement.

Rank changes between two complete UTC weeks

SQL · runnable example
ALTER SESSION SET TIMEZONE = 'UTC';

WITH by_service AS (
  SELECT service_type,
         SUM(CASE WHEN usage_date < DATEADD(day, -8, CURRENT_DATE())
                  THEN credits_billed ELSE 0 END) AS baseline_credits,
         SUM(CASE WHEN usage_date >= DATEADD(day, -8, CURRENT_DATE())
                  THEN credits_billed ELSE 0 END) AS recent_credits
  FROM snowflake.account_usage.metering_daily_history
  WHERE usage_date >= DATEADD(day, -15, CURRENT_DATE())
    AND usage_date < DATEADD(day, -1, CURRENT_DATE())
  GROUP BY service_type
)
SELECT service_type, baseline_credits, recent_credits,
       recent_credits - baseline_credits AS delta_credits
FROM by_service
ORDER BY delta_credits DESC, service_type;

What to expect and why

Both windows cover seven complete days. A single grouped scan keeps services that only appeared in one week. In a fictional result, a service moving from 12 to 20 billed credits has a delta of 8. When a service did not appear before, describe the absolute increase instead of calculating a percentage with a zero denominator.

Look for warehouse configuration changes and restarts

SQL · runnable example
ALTER SESSION SET TIMEZONE = 'UTC';

SELECT timestamp AS event_time, event_name, event_reason, event_state
FROM snowflake.account_usage.warehouse_events_history
WHERE warehouse_name = 'ORDERS_ELT'
  AND timestamp >= DATEADD(day, -15, CURRENT_DATE())
  AND timestamp < DATEADD(day, -1, CURRENT_DATE())
ORDER BY event_time;

What to expect and why

Replace ORDERS_ELT with the affected warehouse. Look for configuration changes and clusters starting or stopping near the spike. A STARTED row gives the beginning of an operation. Use a corresponding completion or consistency event where applicable and check billed usage in warehouse metering.

Check your understanding

Choose an answer, then check your reasoning. This is practice, not a scored test.

What should you do first after seeing an unexpected currency total?

Try it yourself

A week adds 8 compute credits, of which 7 are Automatic Clustering. Name the first drill-down and one fact you would ask the owner for.

Compare your reasoning

Find the table in Automatic Clustering history. Ask when its clustering key or ingestion volume changed, then compare that timestamp with the maintenance records.

Connect this lesson to the learning path

Official sources and curriculum

Module 16 · See module scope

By Rohit Ray · Independent educational lesson · Explore this visual lab