
Snowflake Query Optimizer & Performance Tuner
Optimize Snowflake queries and slash compute costs
What You Can Do
You analyze Snowflake query execution plans to identify performance bottlenecks and recommend optimizations that reduce compute costs. This skill provides data-backed strategies for rewriting inefficient queries, right-sizing warehouse configurations, and restructuring data layouts—giving you measurable improvements in query latency and reduced credit consumption.
Features
Parse Snowflake EXPLAIN output to identify scan types, join orders, and spilling issues
Pinpoint expensive table scans, inefficient joins, or missing clustering keys
Suggest optimal clustering strategies based on query patterns and data distribution
Identify aggregations and common subqueries suitable for persistent views
Detect queries that could benefit from partition elimination strategies
Provide specific SQL rewrites to eliminate full-table scans or redundant operations
Calculate projected credit savings and ROI for each optimization
Recommend compute tier and auto-scaling policies based on workload characteristics
Example Output
Query Analysis Result:
Identified Issue: Full table scan on ORDERS (2.3B rows)
- Current execution: 847 seconds, 142 credits
- Root cause: Missing equality predicate on REGION_ID
Optimization:
```sql
ALTER TABLE ORDERS CLUSTER BY (REGION_ID, ORDER_DATE);
CREATE MATERIALIZED VIEW MV_DAILY_SALES AS
SELECT DATE_TRUNC('day', ORDER_DATE) as day, REGION_ID, SUM(amount) as total
FROM ORDERS GROUP BY 1,2;
Expected improvement: 84% latency reduction (847s → 135s), 71% cost savings (142 → 41 credits per run)
What's Included
- SKILL.md: Complete diagnostic and optimization workflows with decision trees
- Query Analysis Template: Structured checklist for evaluating execution plans
- Optimization Playbook: Common patterns (clustering, materialized views, warehouse sizing)
- Cost Calculator Worksheet: Estimate credit savings from proposed changes
- Snowflake Configuration Reference: Best practices for compute pools, result caching, and staged joins
Who It's For
- Data Engineers — Optimize ETL pipelines and reduce infrastructure costs
- Database Administrators — Tune warehouse configurations and monitor resource usage
- Analytics Engineers — Improve dbt model performance and query latency
- Data Analysts — Speed up ad-hoc queries and dashboard refresh cycles
- Cloud Architects — Right-size Snowflake deployments for cost efficiency
Best For
- Query performance tuning — Debug slow-running queries and rewrite for speed
- Cost optimization — Identify high-credit queries and eliminate waste
- Pipeline diagnostics — Analyze Airflow/dbt execution bottlenecks
- Warehouse capacity planning — Match compute tier to workload demands
- Data architecture decisions — Evaluate clustering, partitioning, and caching strategies







