Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
aj-geddes avatar

Database Performance Debugging

  • 447 installs
  • 305 repo stars
  • Updated March 4, 2026
  • aj-geddes/useful-ai-prompts

database-performance-debugging is a useful-ai-prompts skill that guides diagnosis of slow queries, missing indexes, lock contention, and connection pool exhaustion in production databases.

About

database-performance-debugging is a prompt skill from aj-geddes/useful-ai-prompts for diagnosing production database performance regressions. It structures investigation of slow queries, missing indexes, lock contention, and connection pool exhaustion when latency spikes or cloud database costs climb unexpectedly. Developers reach for database-performance-debugging during incident triage or cost reviews when ORM-generated SQL, index gaps, or pool saturation need systematic analysis rather than guesswork. The skill encodes DBA-style debugging prompts for agent-assisted root-cause work on live systems.

  • Slow-query and execution-plan analysis
  • Index, lock, and contention triage
  • Connection pool and timeout tuning
  • Cost-aware query rewrite guidance
  • Repro steps from prod-like workloads

Database Performance Debugging by the numbers

  • 447 all-time installs (skills.sh)
  • Ranked #131 of 911 Databases skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill database-performance-debugging

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs447
repo stars305
Last updatedMarch 4, 2026
Repositoryaj-geddes/useful-ai-prompts

How do you debug slow production database queries?

Diagnose slow queries, missing indexes, lock contention, and connection pool exhaustion when production database latency spikes or costs climb unexpectedly.

Who is it for?

Backend engineers responding to production database latency spikes, lock waits, or rising managed-database costs.

Skip if: Greenfield schema design with no performance symptoms or teams needing automated APM dashboards instead of guided debugging prompts.

When should I use this skill?

Production database latency spikes, lock contention appears, or connection pool exhaustion is suspected.

What you get

Root-cause analysis for slow queries, index recommendations, lock contention findings, and pool tuning actions

  • Index recommendations
  • Lock contention analysis
  • Pool tuning guidance

Files

SKILL.mdMarkdownGitHub ↗

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;

-- Query profiling
EXPLAIN ANALYZE
SELECT * FROM orders WHERE user_id = 123;
// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
Identify Slow QueriesIdentify Slow Queries
Common Issues & SolutionsCommon Issues & Solutions
Execution Plan AnalysisExecution Plan Analysis
Debugging ProcessDebugging Process

Best Practices

✅ DO

  • Follow established patterns and conventions
  • Write clean, maintainable code
  • Add appropriate documentation
  • Test thoroughly before deploying

❌ DON'T

  • Skip testing or validation
  • Ignore error handling
  • Hard-code configuration values

Related skills

FAQ

What issues does database-performance-debugging cover?

database-performance-debugging covers slow queries, missing indexes, lock contention, and connection pool exhaustion when production database latency spikes or managed-database costs climb unexpectedly.

When should you invoke database-performance-debugging?

Invoke database-performance-debugging during live incidents or cost reviews when query latency, lock waits, or pool saturation need structured DBA-style investigation through agent prompts.

Databasesdatabasesanalytics

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.