Enterprise Data Solutions
Data Engineering

Snowflake Cost Optimization: 12 Ways to Reduce Your Bill

Snowflake costs spiraling out of control? Learn practical techniques to optimize performance and reduce costs by 30-50%.

Alex Thompson
Alex Thompson
Cloud Data Architect
December 15, 2024
14 min read
Snowflake Cost Optimization: 12 Ways to Reduce Your Bill

The Snowflake Cost Challenge

Snowflake's consumption-based pricing is both a blessing and a curse. You pay for what you use, but costs can escalate quickly if not managed properly.

Understanding Snowflake Costs

Two main components:

1. Compute (Virtual Warehouses): Billed per-second, charged by warehouse size

2. Storage: Billed monthly for data stored

Optimization Strategy #1: Right-Size Your Warehouses

Problem: Using XL warehouses for small queries

Solution: Match warehouse size to workload

- XS: Small queries, 1-10 concurrent users

- S/M: Medium queries, 10-50 users

- L/XL: Large queries, heavy transformations

- 2XL+: Massive data loads, complex analytics

Impact: 50-70% cost reduction

Strategy #2: Implement Auto-Suspend Aggressively

ALTER WAREHOUSE my_warehouse

SET AUTO_SUSPEND = 60; -- 1 minute idle time

Best practice: 1-5 minutes for most workloads

Impact: 20-40% reduction in compute costs

Strategy #3: Use Query Result Caching

Snowflake caches query results for 24 hours:

  • No compute charged for cached results
  • Rerun identical queries within 24 hours
  • Educate users to leverage caching
  • Impact: 10-30% reduction

    Strategy #4: Cluster Keys for Large Tables

    ALTER TABLE large_table

    CLUSTER BY (date, region);

    For tables > 1TB with frequent filtering.

    Impact: 30-50% faster queries, lower compute

    Strategy #5: Partition Data by Date

    Use table partitioning for time-series data:

    -- Filter on partitioned column

    SELECT * FROM orders

    WHERE order_date >= '2025-01-01';

    Impact: 70-90% reduction in data scanned

    Strategy #6: Implement Resource Monitors

    CREATE RESOURCE MONITOR monthly_limit

    WITH CREDIT_QUOTA = 1000

    TRIGGERS

    ON 75 PERCENT DO NOTIFY

    ON 100 PERCENT DO SUSPEND;

    Impact: Prevents cost overruns

    Strategy #7: Optimize Data Loading

  • Use `COPY` command, not `INSERT`
  • Load in bulk, not row-by-row
  • Compress files before loading
  • Use appropriate file sizes (100-250MB)
  • Impact: 50-80% faster loads, lower costs

    Strategy #8: Leverage Zero-Copy Cloning

    CREATE TABLE dev_table

    CLONE prod_table;

    For dev/test environments—no storage cost!

    Impact: Eliminate duplicate storage

    Strategy #9: Use Time Travel Judiciously

    ALTER TABLE my_table

    SET DATA_RETENTION_TIME_IN_DAYS = 1;

    Default is 1 day (or 90 for Enterprise)—reduce if not needed.

    Impact: 10-20% storage savings

    Strategy #10: Implement Query Tagging

    ALTER SESSION SET QUERY_TAG = 'marketing_dashboard';

    Track costs by department, project, or user.

    Impact: Better visibility and chargeback

    Strategy #11: Optimize Materialized Views

  • Use for frequently-queried aggregations
  • But beware: they consume compute to refresh
  • Consider dbt incremental models instead
  • Impact: Faster queries, but monitor refresh costs

    Strategy #12: Regular Query Performance Review

    Monitor these views weekly:

  • `ACCOUNT_USAGE.QUERY_HISTORY`
  • `ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY`
  • `ACCOUNT_USAGE.TABLE_STORAGE_METRICS`
  • Identify:

  • Expensive queries
  • Unused warehouses
  • Growing tables
  • Inefficient users
  • Impact: Continuous improvement

    Cost Monitoring Dashboard

    Create a dashboard tracking:

    1. Daily Credits Consumed (by warehouse)

    2. Storage Growth Trend

    3. Top 10 Expensive Queries

    4. Cost per Department (using query tags)

    5. Warehouse Utilization (% time active)

    6. Query Performance Trends

    Real-World Example

    Company: Mid-size SaaS company

    Before: $15,000/month Snowflake bill

    Optimizations:

  • Right-sized 5 warehouses: XL → M
  • Set auto-suspend to 2 minutes
  • Implemented clustering on 3 large tables
  • Reduced time travel to 1 day
  • Created cost monitoring dashboard
  • After: $7,500/month (50% reduction)

    Governance Best Practices

    1. Limit warehouse creation: Require approval

    2. Default small warehouses: Start with XS/S

    3. Mandatory auto-suspend: Set at account level

    4. Resource monitors: Set for each warehouse

    5. Regular reviews: Monthly cost optimization meeting

    6. Training: Educate users on cost implications

    Quick Wins Checklist

  • [ ] Set auto-suspend to 1-5 minutes
  • [ ] Right-size all warehouses
  • [ ] Implement resource monitors
  • [ ] Enable query result caching
  • [ ] Reduce time travel retention
  • [ ] Add clustering to large tables
  • [ ] Implement query tagging
  • [ ] Create cost monitoring dashboard
  • [ ] Schedule monthly review
  • Conclusion

    Snowflake cost optimization is ongoing. Implement these strategies systematically, starting with the quick wins. Monitor continuously and adjust as your workload evolves.

    Expect 30-50% cost reduction in the first month with minimal effort.

    snowflakecost optimizationcloudperformance

    Ready to Transform Your Data Strategy?

    Our team of experts is ready to help you achieve your data goals. Schedule a free consultation to explore how we can work together.