Skip to content
aj-geddes avatar

Database Performance Debugging

Structured debugging guide that finds slow queries, reviews execution plans, and tunes indexes across major databases.

CCM score
35 of 100
skills.sh installs
501
GitHub stars
396
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the full slow-query workflow: enabling logs, ranking offenders, reading plans, and applying index fixes
  • Includes quick-start snippets for MySQL's slow query log, PostgreSQL's pg_stat_statements, and SQL Server's sys.dm_exec_query_stats
  • Organizes detail into four reference guides: identifying slow queries, common issues, execution plan analysis, and the debugging process
  • Designed for engineers diagnosing latency, high database CPU, or performance regressions under load

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill database-performance-debugging -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Database Performance Debugging

Table of Contents

Overview

Database performance issues directly impact application responsiveness. Debugging focuses on identifying slow queries and optimizing execution plans.

When to Use

  • Slow application response times
  • High database CPU
  • Slow queries identified
  • Performance regression
  • Under load stress

Quick Start

Minimal working example:

-- Enable slow query log (MySQL)
SET GLOBAL slow_query_log = 'ON';
SET GLOBAL long_query_time = 0.5;

-- View slow queries
SHOW GLOBAL STATUS LIKE 'Slow_queries';
SELECT * FROM mysql.slow_log;

-- PostgreSQL slow queries
CREATE EXTENSION pg_stat_statements;
SELECT mean_exec_time, calls, query
FROM pg_stat_statements
ORDER BY mean_exec_time DESC LIMIT 10;

-- SQL Server slow queries
SELECT TOP 10
  execution_count,
  total_elapsed_time,
  statement_text
FROM sys.dm_exec_query_stats
ORDER BY total_elapsed_time DESC;

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Categories
Databases, Debugging
First seen
Jun 3, 2026

Questions

What does the database-performance-debugging skill do?

The database-performance-debugging skill debugs database performance issues through query analysis, index optimization, and execution plan review. It helps identify and fix slow queries, with examples for MySQL, PostgreSQL and SQL Server.

When should I use the database-performance-debugging skill?

Use the database-performance-debugging skill for slow application response times, high database CPU, slow queries already identified, performance regressions, or behavior under load stress. Its quick start shows enabling slow query logs and running EXPLAIN ANALYZE on a query.

How do I install the database-performance-debugging skill?

Run npx -y skills add aj-geddes/useful-ai-prompts --skill database-performance-debugging -y in a project to install it. Once installed, the database-performance-debugging skill lets the agent review execution plans and suggest index changes for slow queries.

Where does database-performance-debugging fit among Databases skills?

The database-performance-debugging skill is listed in the Databases category on Claude Marketplaces, alongside supabase-postgres-best-practices and several Prisma skills. It stands apart by focusing on diagnosing slow queries through execution plans and index optimization.

More from aj-geddes/useful-ai-prompts

All 258

Similar to Database Performance Debugging

More Databases