optimizing-query-by-id
CommunitySpeed up Snowflake queries using query IDs
Data & Analytics#query optimization#snowflake#query profiling#partition pruning#sql rewrite#query id#spillage
Authormiptah21
Version1.0.0
Installs0
System Documentation
What problem does it solve?
It eliminates slow, resource-heavy Snowflake queries by turning a query_id into actionable performance diagnostics and an optimized rewritten SQL.
Core Features & Use Cases
- Fetch & analyze query performance from query_id: Retrieves query text and key metrics like execution time, bytes scanned, spillage, and partition pruning.
- Inspect operator-level bottlenecks: Uses query operator statistics to spot row explosions, heavy scans, and spillage-causing operators.
- Rewrite and verify improvements: Produces an optimized query, validates via EXPLAIN, and summarizes expected gains against performance thresholds.
Use Case: You have a previously executed Snowflake query that is slow; provide its query_id and receive an optimized SQL rewrite with before/after plan comparison guidance.
Quick Start
Provide the Snowflake query_id to analyze and rewrite, then ask the assistant to return the optimized SQL plus a concise summary of expected performance improvements.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: optimizing-query-by-id Download link: https://github.com/miptah21/skills/archive/main.zip#optimizing-query-by-id Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.