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.
Installation
Details
Usage
After installing, this skill will be available to your AI coding assistant.
Verify installation:
skills listSkill Instructions
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
- Query Input: The user provides an SQL query to be optimized.
- Analysis: The plugin analyzes the query structure, potential indexing issues, and execution plan (if available).
- 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:
- Analyze the provided SQL query.
- 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:
- Analyze a hypothetical query based on the user's description.
- 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
EXPLAINcan 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.
More by jeremylongshore
View allRabbitmq Queue Setup - Auto-activating skill for Backend Development. Triggers on: rabbitmq queue setup, rabbitmq queue setup Part of the Backend Development skill category.
evaluating-machine-learning-models: This skill allows Claude to evaluate machine learning models using a comprehensive suite of metrics. It should be used when the user requests model performance analysis, validation, or testing. Claude can use this skill to assess model accuracy, precision, recall, F1-score, and other relevant metrics. Trigger this skill when the user mentions "evaluate model", "model performance", "testing metrics", "validation results", or requests a comprehensive "model evaluation".
building-neural-networks: This skill allows Claude to construct and configure neural network architectures using the neural-network-builder plugin. It should be used when the user requests the creation of a new neural network, modification of an existing one, or assistance with defining the layers, parameters, and training process. The skill is triggered by requests involving terms like "build a neural network," "define network architecture," "configure layers," or specific mentions of neural network types (e.g., "CNN," "RNN," "transformer").
Oauth Callback Handler - Auto-activating skill for API Integration. Triggers on: oauth callback handler, oauth callback handler Part of the API Integration skill category.
