database-optimizer

Analyze EXPLAIN plans and performance metrics to optimize PostgreSQL and MySQL databases.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/jsdfhasuh/emosonic --skill database-optimizer-jsdfhasuh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-optimizer
Source: https://github.com/jsdfhasuh/emosonic/tree/main/.agents/skills/database-optimizer
Command: npx skills add https://github.com/jsdfhasuh/emosonic --skill database-optimizer-jsdfhasuh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

database-optimizer helps you diagnose and fix slow queries and inefficient execution by turning raw performance signals (like slow query logs and EXPLAIN plans) into practical, measurable tuning actions.

Core Features & Use Cases

  • Execution plan-driven optimization: Start from EXPLAIN/EXPLAIN ANALYZE to identify real bottlenecks (sequential scans, join strategy issues, misestimates, I/O hotspots) before changing anything.
  • Index and query redesign: Propose targeted index strategies (including composite, covering, partial, and expression indexes) and rewrite queries to avoid common performance traps.
  • DBMS-specific tuning: Apply PostgreSQL and MySQL configuration and maintenance guidance to improve cache efficiency, reduce lock contention, and maintain healthy statistics.

Use cases: optimizing a PostgreSQL report query that regresses after data growth, or improving a MySQL endpoint stuck on table scans by redesigning indexes and rewriting the slow query pattern.

Quick Start

Use the database-optimizer skill to optimize the query for your database by analyzing your EXPLAIN plan first, then proposing an index/query/config change set, and validating the improvement with before/after measurements.

Frequently Asked Questions about database-optimizer

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

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

PostgreSQL query tuning starts by analyzing EXPLAIN ANALYZE execution plans to identify bottlenecks like sequential scans or join strategy issues. The skill proposes targeted index designs and query rewrites, then validates improvements using before and after measurements.

What is the best way to design indexes for MySQL performance monitoring?

MySQL index design involves proposing targeted strategies like composite, covering, partial, and expression indexes to eliminate table scans. The skill analyzes execution plans to identify I/O hotspots and applies DBMS-specific configuration tuning to reduce lock contention.

Can I tune database configuration and maintenance for production-like workloads?

Database configuration tuning applies PostgreSQL and MySQL maintenance guidance to improve cache efficiency and maintain healthy statistics for production-like workloads. The skill produces a measurement-driven optimization plan with specific config changes and monitoring recommendations.

Why does my database performance regress after data growth?

Database performance regresses after data growth when execution plans shift to inefficient strategies like sequential scans or misestimates. The skill diagnoses root causes from EXPLAIN plans and slow query logs, then prescribes schema or partitioning adjustments to restore performance.

How do I validate query tuning changes without skipping EXPLAIN analysis?

Query tuning validation requires running before and after measurement queries to confirm performance gains without over-indexing. The skill generates a measurement-driven optimization plan that includes baseline analysis, specific SQL changes, and validation queries.