indexes-query-optimization

Diagnose slow SQL queries using EXPLAIN output and optimize indexes.

Updated Jun 5, 2026
One-click install
npx skills add https://github.com/hung-phan/system-skills --skill indexes-query-optimization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: indexes-query-optimization
Source: https://github.com/hung-phan/system-skills/tree/main/skills/system-review/references/performance/indexes-query-optimization
Command: npx skills add https://github.com/hung-phan/system-skills --skill indexes-query-optimization

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps diagnose and fix slow SQL queries, improving database performance and efficiency.

Core Features & Use Cases

  • Query Analysis: Analyze slow SQL queries using EXPLAIN and EXPLAIN ANALYZE.
  • Index Optimization: Identify and apply index optimization strategies.
  • Performance Tuning: Implement performance tuning techniques for faster query execution.

Quick Start

Use the indexes-query-optimization skill to analyze a slow query and optimize its performance.

Frequently Asked Questions about indexes-query-optimization

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

FAQPage Schema
How do I optimize slow SQL queries using EXPLAIN ANALYZE output?

To optimize slow SQL queries, analyze the EXPLAIN and EXPLAIN ANALYZE output to identify execution bottlenecks, detect missing or inefficient indexes, and apply query rewriting techniques for faster performance.

How can I find missing indexes causing database performance issues?

You can find missing indexes causing database performance issues by analyzing query execution plans to detect full table scans, then applying targeted index optimization strategies to improve data retrieval efficiency.

What's the best way to rewrite SQL queries for better performance?

The best way to rewrite SQL queries for better performance is to evaluate the EXPLAIN execution plan, identify inefficient operations, and apply query rewriting techniques to streamline database access paths.

Do I need SQL knowledge to diagnose slow database queries?

Yes, you need SQL knowledge and database performance fundamentals to diagnose and optimize slow queries, as interpreting EXPLAIN output and applying indexing strategies require understanding query execution mechanics.

Why does my database query ignore the index and perform a full table scan?

Database queries ignore indexes and perform full table scans when the query optimizer determines a sequential scan is more efficient, often due to inefficient index design or query syntax that prevents index utilization.

Can I use query optimization techniques for any SQL database?

Query optimization techniques focusing on EXPLAIN analysis and indexing apply broadly to SQL databases, though specific syntax and execution plan formats vary across different relational database management systems.