MCP HubMCP Hub
返回技能列表

optimizing-sql-queries

jeremylongshore
更新于 Today
55 次查看
712
74
712
在 GitHub 上查看
data

关于

This skill analyzes SQL queries to identify performance bottlenecks and suggest optimizations like index creation and query rewrites. Use it when developers need to improve slow queries or enhance database efficiency. It provides actionable recommendations by examining query structure and execution plans.

快速安装

Claude Code

推荐
插件命令推荐
/plugin add https://github.com/jeremylongshore/claude-code-plugins-plus
Git 克隆备选方式
git clone https://github.com/jeremylongshore/claude-code-plugins-plus.git ~/.claude/skills/optimizing-sql-queries

在 Claude Code 中复制并粘贴此命令以安装该技能

技能文档

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.

GitHub 仓库

jeremylongshore/claude-code-plugins-plus
路径: backups/skills-batch-20251204-000554/plugins/database/sql-query-optimizer/skills/sql-query-optimizer
aiautomationclaude-codedevopsmarketplacemcp

相关推荐技能