sql-optimization

Analyze SQL execution plans and optimize indexes for MySQL and PostgreSQL queries.

50|13|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/chaterm/terminal-skills --skill sql-optimization-chaterm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-optimization
Source: https://github.com/chaterm/terminal-skills/tree/main/database/sql-optimization
Command: npx skills add https://github.com/chaterm/terminal-skills --skill sql-optimization-chaterm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses slow database performance by providing tools and techniques to analyze and optimize SQL queries, ensuring faster data retrieval and application responsiveness.

Core Features & Use Cases

  • Execution Plan Analysis: Understand how your SQL queries are executed using EXPLAIN and EXPLAIN ANALYZE.
  • Index Optimization: Design, implement, and verify effective indexes for faster lookups.
  • Query Tuning: Refactor queries, optimize JOINs, and manage subqueries for efficiency.
  • Slow Query Identification: Detect and analyze performance bottlenecks in your database.
  • Use Case: A web application is experiencing slow load times due to inefficient database queries. This Skill helps identify the problematic queries, analyze their execution plans, and suggests index or query structure changes to improve performance.

Quick Start

Analyze the execution plan for the SQL query 'SELECT * FROM users WHERE email = '[email protected]';' using the EXPLAIN command.

Frequently Asked Questions about sql-optimization

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

FAQPage Schema
How do I analyze slow SQL queries using execution plans?

Analyze slow SQL queries by running EXPLAIN or EXPLAIN ANALYZE to understand execution plans, revealing bottlenecks in data retrieval and JOIN operations. This Skill helps interpret execution plans to identify performance issues in MySQL and PostgreSQL databases.

What is the best way to optimize MySQL and PostgreSQL query performance?

Optimize MySQL and PostgreSQL query performance through index tuning and query rewriting strategies. This Skill provides techniques to refactor inefficient JOINs, manage subqueries, and design effective indexes for faster database lookups and enhanced application responsiveness.

How do I design effective indexes for faster database lookups?

Design effective indexes for faster database lookups by analyzing query execution plans and identifying missing or inefficient indexes. This Skill helps you implement and verify index strategies to resolve slow query issues and improve data retrieval speed.

Why does my web application experience slow load times due to database queries?

Slow load times often result from inefficient database queries lacking proper indexes or using suboptimal JOIN structures. This Skill helps identify problematic queries, analyze their execution plans, and suggest structural changes to improve database efficiency.

Can I use query tuning to optimize JOINs and subqueries in PostgreSQL?

Yes, you can use query tuning to optimize JOINs and subqueries in PostgreSQL. This Skill provides query rewriting strategies to refactor queries, optimize JOIN operations, and manage subqueries for better database efficiency and faster data retrieval.