Skip to content
Back to skills

Sql Query Optimizer

ASecurity

This skill analyzes and optimizes SQL queries for improved performance. It identifies potential bottlenecks, suggests optimal indexes, and proposes query rewrites. Use this when the user mentions "optimize SQL query", "improve SQL performance", "SQL query optimization", "slow SQL query", or asks for help with "SQL indexing". The skill helps enhance database efficiency by analyzing query structure, recommending indexes, and reviewing execution plans.

  • 21 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added February 7, 2026
databasesgosqldatabaseperformance

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned February 12, 2026

npx -y skills add BbgnsurfTech/claude-skills-collection --skill sql-query-optimizer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sql Query Optimizer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sql Query Optimizer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bbgnsurftech-sql-query-optimizer/badge)](https://www.skillsdirectory.com/skills/bbgnsurftech-sql-query-optimizer)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: optimizing-sql-queries
description: |
  This skill analyzes and optimizes SQL queries for improved performance. It identifies potential bottlenecks, suggests optimal indexes, and proposes query rewrites. Use this when the user mentions "optimize SQL query", "improve SQL performance", "SQL query optimization", "slow SQL query", or asks for help with "SQL indexing". The skill helps enhance database efficiency by analyzing query structure, recommending indexes, and reviewing execution plans.
---

## Overview

This skill empowers Claude to analyze SQL queries, identify performance bottlenecks, and suggest optimizations such as index creation or query rewriting. It leverages the sql-query-optimizer plugin to provide actionable recommendations for improving database performance.

## How It Works

1. **Query Input**: The user provides an SQL query to be optimized.
2. **Analysis**: The plugin analyzes the query structure, potential indexing issues, and execution plan (if available).
3. **Recommendations**: The plugin generates optimization suggestions, including index recommendations and query rewrites.

## When to Use This Skill

This skill activates when you need to:
- Optimize a slow-running SQL query.
- Identify missing or unused indexes in a database.
- Improve the performance of a database application.

## Examples

### Example 1: Optimizing a Slow Query

User request: "Optimize this SQL query: SELECT * FROM orders WHERE customer_id = 123 AND order_date < '2023-01-01';"

The skill will:
1. Analyze the provided SQL query.
2. Suggest creating an index on customer_id and order_date columns to improve query performance.

### Example 2: Finding Indexing Opportunities

User request: "I need help optimizing a query that filters on product_category and price.  Can you suggest any indexes?"

The skill will:
1. Analyze a hypothetical query based on the user's description.
2. Recommend a composite index on (product_category, price) to speed up filtering.

## Best Practices

- **Provide Full Queries**: Include the complete SQL query for accurate analysis.
- **Include EXPLAIN Output**: Providing the output of `EXPLAIN` can help the optimizer identify bottlenecks more effectively.
- **Test Recommendations**: Always test the suggested optimizations in a staging environment before applying them to production.

## Integration

This skill can be used in conjunction with other database management plugins to automate index creation and query rewriting based on the optimizer's suggestions.

Files in this skill

  • SKILL.md2.5 KB
  • assets/README.md252 B
  • references/README.md576 B
  • scripts/README.md368 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…