Home Database Snowflake Cost Optimization: Mastering Credits, Warehouses, and Storage
Advanced 3 min · July 18, 2026
Cost Optimization: Managing Credits, Warehouses, and Storage

Snowflake Cost Optimization: Mastering Credits, Warehouses, and Storage

Learn to optimize Snowflake costs by managing credits, virtual warehouses, and storage.

N
Naren Founder & Principal Engineer

20+ years shipping high-throughput database systems. Notes here come from systems that actually shipped.

Follow
Production
production tested
July 19, 2026
last updated
2,466
articles · all by Naren
Before you start⏱ 15-20 min read
  • Basic understanding of Snowflake architecture (warehouses, databases, schemas).
  • Access to Snowflake account with ACCOUNTADMIN or MONITOR privileges.
  • Familiarity with SQL queries and Snowflake's INFORMATION_SCHEMA.
 ● Production Incident 🔎 Debug Guide ⚙ Triage Commands
Quick Answer
  • Use auto-suspend and auto-resume to avoid paying for idle warehouses.
  • Right-size warehouses by matching size to workload concurrency and complexity.
  • Leverage clustering keys and materialized views to reduce scanned data.
  • Monitor storage costs by compressing and removing stale data.
  • Set resource monitors and budgets to prevent runaway spending.
✦ Definition~90s read
What is Cost Optimization?

Snowflake cost optimization is the practice of managing virtual warehouses, storage, and queries to minimize credit and storage expenses while maintaining performance.

Think of Snowflake like a cloud kitchen: you pay for the ingredients (storage) and the chef's time (compute).
Plain-English First

Think of Snowflake like a cloud kitchen: you pay for the ingredients (storage) and the chef's time (compute). If you leave the chef idle, you still pay. So you want the chef to start cooking only when orders come in (auto-resume) and leave when done (auto-suspend). Also, you don't need a 5-star chef for simple tasks like boiling water (right-size warehouse). And you should organize your pantry (clustering) to find ingredients faster, reducing chef time.

⚙ Browser compatibility
Latest versions — ✓ supported
ChromeFirefoxSafariEdge

Snowflake's pay-as-you-go model is a double-edged sword: it offers elasticity and no upfront costs, but without careful management, your monthly bill can skyrocket. Credits are consumed by virtual warehouses (compute) and storage. Many teams unknowingly waste credits on oversized warehouses, idle compute, or inefficient queries. This tutorial dives deep into cost optimization strategies, from warehouse configuration to storage lifecycle management. You'll learn how to monitor usage, set resource monitors, and implement best practices that can cut costs by 30-50%. We'll also explore a real production incident where a misconfigured warehouse caused a $10k overnight spike. By the end, you'll be equipped to optimize Snowflake costs without sacrificing performance.

This tutorial aligns with the SnowPro Core certification objectives, helping you prepare for the SnowPro exam while building practical skills.

Understanding Snowflake's Pricing Model

Snowflake charges for compute (credits) and storage separately. Compute is consumed by virtual warehouses, which are clusters of compute resources. Storage costs are based on compressed data stored in Snowflake's cloud storage. Additionally, there are costs for cloud services (e.g., metadata operations) but these are usually minimal. Credits are billed per second, with a minimum of 60 seconds per warehouse start. The cost per credit varies by cloud provider and region. For example, on AWS US East, 1 credit = $2.00 (on-demand). Storage costs are typically $23 per terabyte per month (compressed). Understanding these components is the first step to optimization.

🔥Credit Consumption
📊 Production Insight
Many teams forget that auto-suspend only stops the warehouse after a period of inactivity; it does not stop billing immediately. Set auto_suspend to a low value (e.g., 5 minutes) to avoid paying for idle time.
🎯 Key Takeaway
Snowflake costs are driven by warehouse compute (credits) and storage. Know your warehouse sizes and usage patterns.

Right-Sizing Virtual Warehouses

Choosing the right warehouse size is critical. A common mistake is using a large warehouse for small queries, wasting credits. Use the following guidelines: For simple queries (e.g., point lookups), X-Small or Small is sufficient. For complex aggregations or joins on large tables, consider Medium or Large. For very large data loads or complex ETL, use X-Large or larger. Monitor warehouse load using the WAREHOUSE_LOAD_HISTORY view. If a warehouse is less than 50% utilized, consider downsizing. Also, use multi-cluster warehouses only when concurrency demands it; each additional cluster doubles credit consumption.

warehouse_load.sqlSQL
1
2
3
4
5
6
7
8
-- Check average load of a warehouse over the last 7 days
SELECT WAREHOUSE_NAME,
       AVG(AVG_RUNNING) AS avg_running,
       AVG(AVG_QUEUED) AS avg_queued
FROM SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_LOAD_HISTORY
WHERE START_TIME > DATEADD('day', -7, CURRENT_TIMESTAMP)
GROUP BY 1
ORDER BY 2 DESC;
Output
WAREHOUSE_NAME | AVG_RUNNING | AVG_QUEUED
----------------+-------------+------------
COMPUTE_WH | 1.2 | 0.1
LOAD_WH | 0.8 | 0.0
💡Right-Sizing Rule
📊 Production Insight
Avoid using a single warehouse for all workloads. Separate ETL, BI, and ad-hoc queries into different warehouses to prevent contention and allow independent sizing.
🎯 Key Takeaway
Match warehouse size to workload. Use load history to guide sizing decisions.

Auto-Suspend and Auto-Resume Best Practices

Auto-suspend stops a warehouse after a specified period of inactivity, saving credits. Auto-resume starts it automatically when a query is submitted. Set auto_suspend to 5-10 minutes for most warehouses. For development or ad-hoc warehouses, 1 minute is fine. For production warehouses that need to be always available, you might set it longer (e.g., 30 minutes) but be aware of the cost. Never set auto_suspend to NULL (never suspend) unless you have a specific reason. Also, ensure auto_resume is set to TRUE so that the warehouse starts on demand.

alter_warehouse.sqlSQL
1
2
3
4
-- Set auto_suspend to 5 minutes and auto_resume to true
ALTER WAREHOUSE my_wh SET
  AUTO_SUSPEND = 300
  AUTO_RESUME = TRUE;
⚠ Auto-Suspend Gotcha
📊 Production Insight
For warehouses used by scheduled tasks (e.g., dbt runs), consider using a task to start the warehouse before the job and suspend it after, to avoid paying for idle time between runs.
🎯 Key Takeaway
Always set auto_suspend to a low value (e.g., 300 seconds) and enable auto_resume.

Using Resource Monitors to Cap Spending

Resource monitors allow you to set credit limits on warehouses or the entire account. You can define actions when a limit is reached: notify, suspend, or abort queries. Create separate monitors for different warehouses or groups. For example, set a monthly limit of 1000 credits for the BI warehouse, with an alert at 80% and suspend at 100%. This prevents surprise bills. Resource monitors can be set at the account level or warehouse level.

create_resource_monitor.sqlSQL
1
2
3
4
5
6
7
8
9
10
-- Create a resource monitor for a warehouse with 500 credit monthly limit
CREATE RESOURCE MONITOR my_monitor
  WITH CREDIT_QUOTA = 500
  FREQUENCY = MONTHLY
  START_TIMESTAMP = '2025-01-01 00:00:00'
  TRIGGERS ON 80 PERCENT DO NOTIFY
           ON 100 PERCENT DO SUSPEND;

-- Assign monitor to warehouse
ALTER WAREHOUSE my_wh SET RESOURCE_MONITOR = my_monitor;
🔥Monitor Scope
📊 Production Insight
Set up email notifications for resource monitor alerts so the team can act before the warehouse is suspended.
🎯 Key Takeaway
Use resource monitors to enforce credit budgets and receive alerts before costs spiral.

Optimizing Storage Costs

Storage costs are based on compressed data. Snowflake automatically compresses data, but you can reduce storage by: 1) Dropping unused tables and schemas. 2) Reducing Time Travel retention (default 1 day, max 90 days). Each day of Time Travel adds to storage. 3) Using clustering keys to improve compression and query performance. 4) Archiving old data to cheaper storage (e.g., S3 Glacier). Monitor storage with TABLE_STORAGE_METRICS and STAGE_STORAGE_USAGE_HISTORY.

storage_metrics.sqlSQL
1
2
3
4
5
6
7
-- Find top 10 largest tables by active bytes
SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME,
       ACTIVE_BYTES / 1024/1024/1024 AS ACTIVE_GB,
       TIME_TRAVEL_BYTES / 1024/1024/1024 AS TT_GB
FROM SNOWFLAKE.ACCOUNT_USAGE.TABLE_STORAGE_METRICS
ORDER BY ACTIVE_BYTES DESC
LIMIT 10;
Output
TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | ACTIVE_GB | TT_GB
--------------+--------------+------------+-----------+-------
MYDB | PUBLIC | SALES | 150.2 | 5.3
MYDB | PUBLIC | ORDERS | 89.7 | 2.1
💡Time Travel Cost
📊 Production Insight
Use zero-copy cloning to create development copies without duplicating storage. This saves costs compared to full table copies.
🎯 Key Takeaway
Regularly audit storage and reduce Time Travel retention to minimize costs.

Query Optimization to Reduce Compute

Inefficient queries waste credits. Use clustering keys to minimize data scanned. For large tables, define clustering keys on columns used in filters (e.g., date). Also use materialized views for pre-aggregated results. Avoid SELECT *; only select needed columns. Use query profiling (EXPLAIN) to identify full scans or large joins. Set up automatic clustering for tables that benefit from it. Monitor query performance with QUERY_HISTORY.

clustering_example.sqlSQL
1
2
3
4
5
6
-- Add clustering key on date column
ALTER TABLE sales CLUSTER BY (sale_date);

-- Check clustering status
SELECT * FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'SALES' AND TABLE_SCHEMA = 'PUBLIC';
🔥Automatic Clustering
📊 Production Insight
For dashboards, consider using materialized views to pre-compute aggregations. This reduces query time and credit usage for repeated queries.
🎯 Key Takeaway
Optimize queries to scan less data. Use clustering, materialized views, and selective columns.

Monitoring and Alerting with Account Usage Views

Snowflake provides rich account usage views in the SNOWFLAKE database. Key views: WAREHOUSE_METERING_HISTORY (credit consumption), QUERY_HISTORY (query performance), TABLE_STORAGE_METRICS (storage), and RESOURCE_MONITORS (monitor status). Set up regular queries to generate cost reports. You can also use Snowsight dashboards to visualize usage. Consider setting up alerts for unusual spikes using tasks or external tools.

cost_report.sqlSQL
1
2
3
4
5
6
7
8
-- Daily credit usage by warehouse for the last 7 days
SELECT DATE(START_TIME) AS day,
       WAREHOUSE_NAME,
       SUM(CREDITS_USED) AS credits
FROM SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY
WHERE START_TIME > DATEADD('day', -7, CURRENT_TIMESTAMP)
GROUP BY 1, 2
ORDER BY 1, 2;
Output
DAY | WAREHOUSE_NAME | CREDITS
-----------+----------------+--------
2025-03-01 | COMPUTE_WH | 12.5
2025-03-01 | LOAD_WH | 8.2
💡Automate Monitoring
📊 Production Insight
Use the QUERY_HISTORY view to find queries that scan large amounts of data (e.g., BYTES_SCANNED > 1TB). Optimize those queries to reduce costs.
🎯 Key Takeaway
Regularly monitor usage views to identify cost trends and anomalies.
● Production incidentPOST-MORTEMseverity: high

The $10k Overnight Warehouse Spiral

Symptom
The finance team noticed a $10,000 spike in Snowflake costs over a single weekend.
Assumption
Developers assumed that auto-suspend was enabled on all warehouses.
Root cause
A newly created warehouse for a data load job had auto-suspend set to NULL (never suspend) and was left running after the job completed.
Fix
Set auto_suspend to 5 minutes for all warehouses and implemented resource monitors with alerts.
Key lesson
  • Always set auto_suspend on every warehouse, especially for ad-hoc or temporary workloads.
  • Use resource monitors to cap credit usage and send alerts.
  • Regularly audit warehouse configurations with SHOW WAREHOUSES.
  • Implement a process to review and clean up unused warehouses.
  • Enable auto-resume to avoid manual start/stop.
Production debug guideSymptom to Action4 entries
Symptom · 01
Unexpected high credit consumption
Fix
Check ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY to identify which warehouse consumed the most credits.
Symptom · 02
Warehouse never suspends
Fix
Run SHOW WAREHOUSES and verify auto_suspend is set to a reasonable value (e.g., 5 minutes).
Symptom · 03
Queries running longer than expected
Fix
Use QUERY_HISTORY to find long-running queries and optimize them (e.g., add clustering, rewrite joins).
Symptom · 04
Storage costs increasing
Fix
Query INFORMATION_SCHEMA.TABLE_STORAGE_METRICS to find large tables and consider compression or time travel retention reduction.
★ Quick Debug Cheat SheetImmediate steps to diagnose cost issues.
High credit usage
Immediate action
Identify top warehouses by credits
Commands
SELECT WAREHOUSE_NAME, SUM(CREDITS_USED) FROM SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY WHERE START_TIME > DATEADD('day', -7, CURRENT_TIMESTAMP) GROUP BY 1 ORDER BY 2 DESC;
SHOW WAREHOUSES;
Fix now
Set auto_suspend to 5 minutes and reduce warehouse size if possible.
Long-running queries+
Immediate action
Find top 10 longest queries
Commands
SELECT QUERY_ID, USER_NAME, WAREHOUSE_NAME, TOTAL_ELAPSED_TIME/1000 AS SECONDS FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY WHERE START_TIME > DATEADD('day', -1, CURRENT_TIMESTAMP) ORDER BY TOTAL_ELAPSED_TIME DESC LIMIT 10;
EXPLAIN USING JSON <query_id>;
Fix now
Add clustering keys or rewrite query to reduce data scanned.
Storage growing fast+
Immediate action
Check table sizes
Commands
SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, ACTIVE_BYTES / 1024/1024/1024 AS GB FROM SNOWFLAKE.ACCOUNT_USAGE.TABLE_STORAGE_METRICS ORDER BY ACTIVE_BYTES DESC LIMIT 10;
SELECT * FROM SNOWFLAKE.ACCOUNT_USAGE.AUTOMATIC_CLUSTERING_HISTORY;
Fix now
Drop unused tables or reduce TIME_TRAVEL_RETENTION_IN_DAYS.
StrategyPotential SavingsEffortRisk
Auto-suspendHighLowLow
Multi-cluster warehousesMediumMediumMedium
Materialized viewsMediumHighLow
Clustering keysMediumMediumLow
Query accelerationLowLowLow
Storage optimizationHighMediumLow
Warehouse sizingHighLowLow
⚙ Quick Reference
6 commands from this guide
FileCommand / CodePurpose
warehouse_load.sqlSELECT WAREHOUSE_NAME,Right-Sizing Virtual Warehouses
alter_warehouse.sqlALTER WAREHOUSE my_wh SETAuto-Suspend and Auto-Resume Best Practices
create_resource_monitor.sqlCREATE RESOURCE MONITOR my_monitorUsing Resource Monitors to Cap Spending
storage_metrics.sqlSELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME,Optimizing Storage Costs
clustering_example.sqlALTER TABLE sales CLUSTER BY (sale_date);Query Optimization to Reduce Compute
cost_report.sqlSELECT DATE(START_TIME) AS day,Monitoring and Alerting with Account Usage Views

Key takeaways

1
Always set auto_suspend and auto_resume on every warehouse to avoid paying for idle compute.
2
Right-size warehouses based on workload and monitor load history.
3
Use resource monitors to enforce budgets and receive alerts.
4
Optimize storage by reducing Time Travel retention and dropping unused tables.
5
Improve query efficiency with clustering keys and materialized views to reduce scanned data.

Common mistakes to avoid

3 patterns
×

Setting auto_suspend to NULL or 0

×

Using a single large warehouse for all queries

×

Not using resource monitors

INTERVIEW PREP · PRACTICE MODE

Interview Questions on This Topic

Q01JUNIOR
Explain how Snowflake's pricing model works.
Q02SENIOR
How would you troubleshoot a sudden spike in credit usage?
Q03SENIOR
Describe a strategy to reduce costs for a data warehouse used by multipl...
Q01 of 03JUNIOR

Explain how Snowflake's pricing model works.

ANSWER
Snowflake charges for compute (credits consumed by virtual warehouses) and storage (compressed data). Compute is billed per second with a 60-second minimum. Storage is billed per terabyte per month. There are also minimal charges for cloud services.
FAQ · 5 QUESTIONS

Frequently Asked Questions

01
What is the minimum auto_suspend time I can set?
02
How do I estimate my monthly Snowflake costs?
03
Can I set different resource monitors for different warehouses?
04
What is the best way to reduce storage costs?
05
How do clustering keys help reduce costs?
N
Naren Founder & Principal Engineer

20+ years shipping high-throughput database systems. Notes here come from systems that actually shipped.

Follow
Verified
production tested
July 19, 2026
last updated
2,466
articles · all by Naren
🔥

That's Snowflake. Mark it forged?

3 min read · try the examples if you haven't

Previous
Query Optimization: Clustering Keys, Search Optimization, and Profiling
12 / 33 · Snowflake
Next
Semi-Structured Data: JSON, Parquet, Avro, and VARIANT