Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

sql-query-optimizer

Skill by a5c-ai

Analyzes and optimizes SQL queries for Snowflake, BigQuery, Redshift and Databricks, with platform-specific recommendations. Aimed at data engineers and analytics engineers working on warehouse query performance.

  • Score 68
  • 1.9k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install sql-query-optimizer

Built from the published package, never by AI.

git clone --depth 1 https://github.com/a5c-ai/babysitter /tmp/babysitter && mkdir -p ~/.claude/skills && cp -r /tmp/babysitter/library/specializations/data-engineering-analytics/skills/sql-query-optimizer ~/.claude/skills/sql-query-optimizer

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install sql-query-optimizer in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

SQL Query Optimizer is an agent skill, defined in a SKILL.md file, that examines SQL queries to find performance bottlenecks and suggest optimizations. It covers Snowflake, BigQuery, Redshift and Databricks, and its input schema also lists PostgreSQL. The required inputs are a query and a platform. Table statistics, an EXPLAIN execution plan, query history and optimization goals are optional.

The output includes an optimized query, a list of improvements with impact ratings, and index or clustering key recommendations with DDL. It also estimates scan, time and cost reductions and flags anti-patterns. The skill is aimed at data engineers and analytics engineers. Version 1.0.0 is the initial release, and the source lists related skills and MCP server integrations for Snowflake, BigQuery and Redshift.

Written from the project's SKILL.md and checked against it.

What it can do

  • Query execution plan analysisParses and analyzes EXPLAIN outputs to find performance bottlenecks.
  • Index recommendationsSuggests clustering keys, sort keys, partition keys and indexes, with DDL.
  • Join optimizationIdentifies inefficient join patterns and suggests improvements.
  • Subquery eliminationConverts correlated subqueries to CTEs or joins.
  • Window function optimizationReviews window frame and partition optimization.
  • Predicate pushdown validationChecks whether filters are pushed down effectively.
  • Materialized view suggestionsIdentifies candidates for materialized views.
  • Platform-specific optimizationsGives recommendations for Snowflake, BigQuery, Redshift and Databricks.
  • Anti-pattern detectionFlags issues such as SELECT *, cartesian products and aggregating before filtering.

Try asking

  • Optimize this Snowflake query and suggest clustering keys for the orders table.
  • Check this BigQuery SQL for anti-patterns and rate the impact of each fix.
  • Review my Redshift query plan and recommend sort and distribution keys.

Good to know

  • The input schema lists postgres as a platform, but the description and platform sections cover four warehouses.
  • MCP integrations for Snowflake, BigQuery and Redshift are listed without setup details.

Security check

B
  • Allowed to use Bash without limitsIn SKILL.md

Checked automatically: library/specializations/data-engineering-analytics/skills/sql-query-optimizer/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

Allowed tools: ReadGrepGlobBashWebFetch

Alternatives to sql-query-optimizer

All alternatives →
kaggle-cliKaggle
94

Guides an assistant through the Kaggle CLI, covering competitions, datasets, notebooks, models, benchmarks, authentication and quota. It is for people who use the kaggle command-line tool.

AAA Skill 7.7k
bigquery-bigframesgoogle
94

Generates Python code that uses BigQuery DataFrames (BigFrames) for data processing, analysis and machine learning on BigQuery. It is meant for Python data tasks, and the source says to use bigquery-basics for SQL-first workflows.

AAA Skill 25k
data-loadingmicrosoft
94

Discovers connected data sources and proposes loading options when a workspace lacks the data a question needs. Suited to users who want to connect database, warehouse or cloud sources from the chat.

AAA Skill 18k
data-manager-api-setupgoogle
94

Guides developers through enabling the Data Manager API, setting up Application Default Credentials, and installing its client libraries. Built for developers who are getting started with the API and need local environment and access setup.

AAA Skill 25k
managed-airflow-dag-authoringgoogle
94

Guides authoring and validating Apache Airflow DAGs for Managed Service for Apache Airflow (MSAA), formerly Cloud Composer. Built for developers who create or extend Airflow DAGs in these environments.

AAA Skill 25k
data-feedsdavila7
94

Extracts structured JSON data from over 40 websites, including Amazon, LinkedIn, Instagram, TikTok, Facebook and YouTube. Built on Bright Data's Web Data APIs, it returns product details, profiles, reviews, posts and comments from a URL.

AAA Skill 34k

Compare with kaggle-cli, bigquery-bigframes or data-loading

sql-query-optimizer: common questions

Which data warehouses does the SQL Query Optimizer support?

The source names Snowflake, BigQuery, Redshift and Databricks, with platform-specific recommendations for each. The input schema also lists postgres as an option.

What inputs does it accept?

A SQL query and a platform are required. Optional inputs are table statistics, an EXPLAIN execution plan, query history and optimization goals such as latency, cost, throughput and scan reduction.

Does it connect to my warehouse?

The source lists MCP integrations for Snowflake, BigQuery and Redshift for real-time plan analysis, cost estimation and statistics. It does not describe setup steps for these connections.

How do I install sql-query-optimizer?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is sql-query-optimizer free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is sql-query-optimizer safe to use?

It scores 68 of 100. Grades: maintenance B, licence A, quality A. Security check: grade B (allowed to use bash without limits). Review the code before you install. How grades work.

What are alternatives to sql-query-optimizer?

Similar skills: kaggle-cli, bigquery-bigframes, data-loading, data-manager-api-setup.

sql-query-optimizer Install

Add to stack

Loading.