query-optimizer

Analyze SQL query performance and identify bottlenecks using EXPLAIN tools.

27|4|Updated Oct 20, 2025
One-click install
npx skills add https://github.com/CuriousLearner/devkit --skill query-optimizer-curiouslearner
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: query-optimizer
Source: https://github.com/CuriousLearner/devkit/tree/main/skills/query-optimizer
Command: npx skills add https://github.com/CuriousLearner/devkit --skill query-optimizer-curiouslearner

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses slow-performing SQL queries that lead to application slowdowns and increased infrastructure costs by analyzing and optimizing their execution plans.

Core Features & Use Cases

  • Performance Analysis: Identifies bottlenecks like full table scans, missing indexes, and inefficient joins using EXPLAIN and other tools.
  • Query Optimization: Provides actionable recommendations for index creation, query rewriting, and caching strategies.
  • Use Case: A web application's user dashboard is loading slowly. The @query-optimizer skill can analyze the SELECT statements responsible for fetching user data and suggest adding an index to the users table on the created_at column, significantly speeding up load times.

Quick Start

Use the query-optimizer skill to analyze the performance of the following SQL query: SELECT * FROM orders WHERE user_id = 123.

Frequently Asked Questions about query-optimizer

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

FAQPage Schema
How do I optimize SQL query performance when my application dashboard is loading slowly?

To optimize SQL query performance for slow dashboards, you can use EXPLAIN and EXPLAIN ANALYZE to identify bottlenecks like full table scans or missing indexes. Adding an index to frequently filtered columns, such as created_at, significantly speeds up data fetching and load times.

What's the best way to fix the N+1 query problem and inefficient joins in PostgreSQL?

The best way to fix the N+1 query problem and inefficient joins in PostgreSQL is by analyzing execution plans with EXPLAIN ANALYZE to pinpoint structural inefficiencies. Rewriting suboptimal query structures and applying appropriate indexing strategies eliminates redundant database calls and improves join performance.

Does query tuning work with MySQL and the performance schema?

Yes, query tuning works with MySQL by utilizing the performance schema and EXPLAIN output to identify slow-performing queries. It analyzes missing indexes and inefficient joins, providing actionable recommendations to optimize SQL execution plans and reduce infrastructure costs.

How do I use EXPLAIN to identify missing indexes causing full table scans?

To use EXPLAIN to identify missing indexes causing full table scans, run EXPLAIN or EXPLAIN ANALYZE on your SELECT statement. The execution plan will reveal sequential scans, indicating where creating indexes on filtered columns will optimize query performance.

Why does my SQL query execution plan show a full table scan instead of using an index?

Your SQL query execution plan shows a full table scan instead of using an index because of missing indexes on filtered columns or suboptimal query structures. Analyzing the EXPLAIN output helps identify these bottlenecks and provides recommendations for index creation and query rewriting.

What caching strategies and query rewriting techniques help with database optimization?

Caching strategies and query rewriting techniques for database optimization reduce application slowdowns by minimizing redundant data retrieval. Analyzing execution plans with EXPLAIN identifies inefficient joins and suboptimal structures, enabling actionable recommendations for index creation and query restructuring.