snowflake-performance-tuning

Solid

Optimize Snowflake query performance with clustering, materialized views, caching, and query profiling. Use when queries are slow, analyzing QUERY_HISTORY for bottlenecks, or optimizing warehouse utilization and data scanning. Trigger with phrases like "snowflake performance", "optimize snowflake", "snowflake slow query", "snowflake clustering", "snowflake query profile".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Snowflake Performance Tuning ## Overview Optimize Snowflake query performance using clustering keys, materialized views, result caching, query profiling, and warehouse tuning. ## Prerequisites - Access to `SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY` - Understanding of micro-partitions and pruning - Role with `MONITOR` privilege on warehouses ## Instructions ### Step 1: Identify Slow Queries ```sql -- Top 20 slowest queries in last 24 hours SELECT query_id, query_text, total_elapsed_time / 1000 AS seconds, bytes_scanned / 1e9 AS gb_scanned, partitions_scanned, partitions_total, ROUND(partitions_scanned / NULLIF(partitions_total, 0) * 100, 1) AS pct_scanned, warehouse_name, warehouse_size FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY WHERE execution_status = 'SUCCESS' AND start_time >= DATEADD(hours, -24, CURRENT_TIMESTAMP()) AND query_type = 'SELECT' ORDER BY total_elapsed_time DESC LIMIT 20; -- Queries scanning too many partitions (poor pruning) SELECT query_id, query_text, partitions_scanned, partitions_total, bytes_scanned / 1e9 AS gb_scanned FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY WHERE partitions_scanned > partitions_total * 0.5 AND partitions_total > 100 AND start_time >= DATEADD(hours, -24, CURRENT_TIMESTAMP()) ORDER BY partitions_scanned DESC LIMIT 10; ``` ### Step 2: Add Clustering Keys ```sql -- Clustering improves pruning for large tables (> 1TB) -- Choose columns used in WHERE and JOIN clauses -- Cluster by ...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

snowflake-advanced-troubleshooting

Apply advanced Snowflake debugging with query profiling, spill analysis, lock contention, and performance deep-dives using ACCOUNT_USAGE views. Use when standard troubleshooting fails, investigating slow queries, or diagnosing warehouse performance issues. Trigger with phrases like "snowflake hard bug", "snowflake slow query debug", "snowflake query profile", "snowflake spilling", "snowflake deep debug".

2,266 Updated today
jeremylongshore
AI & Automation Featured

snowflake-load-scale

Implement Snowflake load testing, warehouse scaling, and capacity planning. Use when testing query performance at scale, configuring multi-cluster warehouses, or planning capacity for production Snowflake workloads. Trigger with phrases like "snowflake load test", "snowflake scale", "snowflake capacity", "snowflake benchmark", "snowflake multi-cluster".

2,266 Updated today
jeremylongshore
AI & Automation Featured

snowflake-cost-tuning

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".

2,266 Updated today
jeremylongshore
AI & Automation Solid

snowflake-observability

Set up Snowflake observability using ACCOUNT_USAGE views, alerts, and external monitoring. Use when implementing Snowflake monitoring dashboards, setting up query performance tracking, or configuring alerting for warehouse and pipeline health. Trigger with phrases like "snowflake monitoring", "snowflake metrics", "snowflake observability", "snowflake dashboard", "snowflake alerts".

2,266 Updated today
jeremylongshore
AI & Automation Solid

snowflake-rate-limits

Handle Snowflake concurrency limits, warehouse queuing, and query throttling. Use when queries are queuing, hitting concurrency limits, or needing to optimize warehouse sizing for throughput. Trigger with phrases like "snowflake rate limit", "snowflake throttling", "snowflake queuing", "snowflake concurrency", "snowflake warehouse sizing".

2,266 Updated today
jeremylongshore