optimizing-query-text

Optimize Snowflake SQL query text with semantics-preserving transformations.

2|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/miptah21/skills --skill optimizing-query-text
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: optimizing-query-text
Source: https://github.com/miptah21/skills/tree/main/.agents/skills/optimizing-query-text
Command: npx skills add https://github.com/miptah21/skills --skill optimizing-query-text

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you improve the performance of Snowflake SQL by rewriting your provided query to eliminate common performance anti-patterns while preserving identical results.

Core Features & Use Cases

  • Snowflake query tuning from text: Optimizes SQL performance based on the query you paste, without changing the intent or output.
  • Safe pattern-based rewrites: Applies targeted transformations like converting function-wrapped filters into equivalent range predicates and replacing implicit joins with explicit JOIN syntax.
  • Result-preservation guardrails: Ensures column order, selected fields, filtering semantics, ORDER BY, and LIMIT behavior remain identical; if it cannot guarantee equivalence, it returns the original query unchanged.
  • Use case: A business analyst has a slow Snowflake dashboard query and needs it optimized for faster interactive performance.

Quick Start

Paste your Snowflake SQL query and ask the assistant to optimize it for better performance.

Frequently Asked Questions about optimizing-query-text

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize slow Snowflake SQL queries?

To optimize slow Snowflake SQL queries, paste the query text into the assistant to apply safe, pattern-based rewrites that eliminate performance anti-patterns while preserving identical results, output schema, and LIMIT semantics.

What are common Snowflake SQL performance anti-patterns?

Common Snowflake SQL performance anti-patterns include function-wrapped filter predicates and inefficient implicit join patterns. Rewriting these into equivalent range predicates and explicit JOIN syntax improves runtime without changing output.

Does query rewriting change the output schema or ordering?

Query rewriting does not change the output schema or ordering. Result-preservation guardrails ensure column order, selected fields, filtering semantics, ORDER BY, and LIMIT behavior remain identical to the original query.

What happens if a Snowflake query cannot be safely optimized?

If a Snowflake query cannot be safely optimized, the original query is returned unchanged. The tool only applies semantics-preserving transformations when it can guarantee identical results.

Can I use this for tuning dashboard queries in Snowflake?

Yes, you can use this for tuning dashboard queries in Snowflake. It is designed to help business analysts improve interactive performance by rewriting slow queries without altering their intent or output.