| name | snowflake-cost-tuning |
| description | Optimize Snowflake costs with resource monitors, warehouse auto-suspend,
right-sizing, and credit consumption analysis.
Use when analyzing Snowflake billing, reducing credit consumption,
or implementing cost controls and budget alerts.
Trigger with phrases like "snowflake cost", "snowflake billing",
"reduce snowflake cost", "snowflake credits", "snowflake expensive", "snowflake budget".
|
| allowed-tools | Read, Grep |
| version | 1.5.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","data-warehouse","analytics","snowflake"] |
| compatibility | Designed for Claude Code |
Snowflake Cost Tuning
Overview
Optimize Snowflake costs through resource monitors, warehouse right-sizing, auto-suspend tuning, and credit consumption analysis.
Snowflake Pricing Model
| Cost Component | What It Measures | Typical % of Bill |
|---|
| Compute (credits) | Warehouse running time | 60-80% |
| Storage | Data at rest (compressed) | 10-20% |
| Cloud services | Metadata ops, auth, compilation | 5-10% |
| Data transfer | Egress between regions/clouds | 0-5% |
| Serverless | Snowpipe, auto-clustering, MV refresh | Variable |
Credit rates by warehouse size:
| Size | Credits/Hour | Nodes |
|---|
| X-Small | 1 | 1 |
| Small | 2 | 2 |
| Medium | 4 | 4 |
| Large | 8 | 8 |
| X-Large | 16 | 16 |
| 2X-Large | 32 | 32 |
Instructions
Step 1: Analyze Current Credit Consumption
SELECT warehouse_name,
SUM(credits_used) AS total_credits,
SUM(credits_used_compute) AS compute_credits,
SUM(credits_used_cloud_services) AS cloud_credits,
ROUND(SUM(credits_used) * 3.0, 2) AS est_cost_usd
FROM SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY
WHERE start_time DATEADD(days, , ())
warehouse_name
total_credits ;
DATE_TRUNC(, start_time) ,
(credits_used) credits
SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY
start_time DATEADD(days, , ())
;
warehouse_name,
(credits_used) total_credits,
( query_id) queries,
( query_id) (credits_used)
idle_credits
SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY w
SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY q
w.warehouse_name q.warehouse_name
DATE_TRUNC(, w.start_time) DATE_TRUNC(, q.start_time)
w.start_time DATEADD(days, , ())
warehouse_name
idle_credits ;