database-optimizer

Analyze EXPLAIN execution plans to identify and validate PostgreSQL and MySQL database bottlenecks.

1|Updated May 16, 2026
One-click install
npx skills add https://github.com/enigmaicon-eng/AI-Enterprise-OS --skill database-optimizer-enigmaicon-eng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-optimizer
Source: https://github.com/enigmaicon-eng/AI-Enterprise-OS/tree/main/examples/claude-skills/skills/database-optimizer
Command: npx skills add https://github.com/enigmaicon-eng/AI-Enterprise-OS --skill database-optimizer-enigmaicon-eng

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you reduce slow query latency and improve database performance by identifying what the query planner is actually doing and applying safe, measurable optimizations.

Core Features & Use Cases

  • Execution plan–driven tuning: Use EXPLAIN (ANALYZE, BUFFERS) to pinpoint bottlenecks like sequential scans, bad join strategies, cache miss patterns, and sort spill behavior.
  • Index and schema optimization: Design and validate index strategies (including covering, partial, expression-based indexes) across PostgreSQL and MySQL.
  • Performance monitoring & validation loop: Measure before/after using timing, cost, buffer hit ratios, and index usage to ensure changes actually help.

Use case: Your PostgreSQL endpoint is timing out during a reporting query—use this Skill to capture an execution plan, find the largest cost driver, propose the right indexes or query rewrites, and verify improvements with a second plan review.

Quick Start

Ask the AI to optimize the query by first capturing and analyzing EXPLAIN (ANALYZE, BUFFERS) results for your slow statement, then suggesting the smallest safe set of index or query changes and validating them with a before/after comparison.

Frequently Asked Questions about database-optimizer

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

FAQPage Schema
How do I tune slow PostgreSQL queries using execution plans?

To tune slow PostgreSQL queries, capture EXPLAIN (ANALYZE, BUFFERS) output to pinpoint bottlenecks like sequential scans or bad join strategies, then apply targeted index design and query rewrites to reduce latency.

What is the best way to diagnose MySQL query performance bottlenecks?

Diagnosing MySQL query performance bottlenecks requires analyzing execution plans to identify cost drivers like full table scans and sort spills, then validating index strategies and query changes with before/after comparisons.

When should I use covering or partial indexes for database optimization?

Use covering or partial indexes for database optimization when execution plans show repeated table lookups or high buffer miss ratios, allowing the query planner to fetch data directly from the index structure.

How do I validate that index changes actually improve database performance?

Validate index changes by measuring database performance before and after modifications, comparing execution plan costs, timing, and buffer hit ratios to ensure the tuning adjustments reduce query latency safely.

Does this query tuning approach work for cache and lock contention issues?

Yes, query tuning applies to cache and lock contention by analyzing execution plans for buffer miss patterns and locking behavior, then applying configuration validation and query rewrites to reduce resource contention.