aj-geddes avatar

Database Performance Debugging

This handles the standard database performance workflow: enabling slow query logs, identifying problematic queries, and analyzing execution plans across MySQL, PostgreSQL, and SQL Server. You'd reach for it when your app suddenly gets sluggish under load or you're tracking down a performance regression. The quick start gives you actual SQL commands to flip on logging and pull execution stats, which is handy if you don't work with a particular database daily. It won't teach you deep database internals, but it covers the practical debugging cycle most teams need when queries start crawling.

skills.sh installs
499
GitHub stars
379
last updated
Aug 21, 2026

Install

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

Installs into .claude/skills of the current project.

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;

Sponsors

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Categories
Backend & APIs, Git & Pull Requests, Code Review & Quality, AI & Agent Building, Debugging, Productivity & Planning, Marketing & SEO, Databases
First seen
Jun 3, 2026

More from aj-geddes/useful-ai-prompts

All 258
1davila7 avatarapi-documentation-generatordavila7/claude-code-templatesGenerate comprehensive, developer-friendly API documentation from code, including endpoints, parameters, examples, and best practices493skills.sh installs
2firebase avatarfirebase-ai-logicfirebase/skillsfirebase ai logic491skills.sh installs
3yoanbernabeu avatarsupabase-extract-urlyoanbernabeu/supabase-pentest-skillsExtract the Supabase project URL from client-side JavaScript code, environment variables, and configuration files.487skills.sh installs
4aj-geddes avatarapi-versioning-strategyaj-geddes/useful-ai-promptsImplement API versioning strategies including URL versioning, header versioning, backward compatibility, deprecation strategies, and migration guides. Use when 472skills.sh installs
5secondsky avatarapi-error-handlingsecondsky/claude-skillsImplements standardized API error responses with proper status codes, logging, and user-friendly messages. Use when building production APIs, implementing error455skills.sh installs
6sickn33 avatarapi-testing-observability-api-mocksickn33/antigravity-awesome-skillsapi testing observability api mock451skills.sh installs