database-optimizer

Identify slow queries and validate index strategies with EXPLAIN ANALYZE across PostgreSQL and MySQL.

Updated Jan 9, 2026
One-click install
npx skills add https://github.com/dieu-donnee/luxtrax --skill database-optimizer-dieu-donnee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-optimizer
Source: https://github.com/dieu-donnee/luxtrax/tree/main/.agent/skills/database-optimizer
Command: npx skills add https://github.com/dieu-donnee/luxtrax --skill database-optimizer-dieu-donnee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Database performance often degrades when queries are slow or execution plans are suboptimal; this Skill provides a structured, field-tested approach to optimize queries, indexing, and configuration across PostgreSQL and MySQL.

Core Features & Use Cases

  • Expert guidance for performance tuning, query optimization, index design, and plan analysis.
  • Applicable to slow queries, large schemas, and high-concurrency workloads across PostgreSQL and MySQL.
  • Real-world use case: diagnose a slow-reporting query and implement an indexing strategy to reduce runtime.

Quick Start

Analyze a representative slow query with EXPLAIN ANALYZE, identify bottlenecks, and implement a targeted change, then re-validate performance.

Frequently Asked Questions about database-optimizer

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

FAQPage Schema
How do I identify slow PostgreSQL queries and optimize their execution plans?

To identify slow PostgreSQL queries, capture a performance baseline with EXPLAIN ANALYZE to expose bottlenecks in the execution plan, then apply targeted index strategies or query rewrites to reduce runtime and validate the improvement.

What is the best way to tune MySQL indexes for high-concurrency workloads?

Tuning MySQL indexes for high-concurrency workloads requires analyzing suboptimal execution plans with EXPLAIN ANALYZE, designing targeted index strategies to reduce query bottlenecks, and validating configuration changes against measured baselines to ensure scalable performance improvements.

Why does my database reporting query take so long to run, and how can I fix it?

A slow database reporting query often stems from suboptimal execution plans or missing indexes; diagnose the exact bottleneck using EXPLAIN ANALYZE, implement an indexing strategy or rewrite the query, and re-validate the runtime to ensure measurable performance gains.

Can I optimize large database schemas for both PostgreSQL and MySQL using the same approach?

Yes, you can optimize large database schemas across PostgreSQL and MySQL using a structured approach that captures baselines, analyzes execution plans with EXPLAIN ANALYZE, validates index strategies, and monitors configuration changes to ensure scalable query performance improvements.

When should I rewrite a slow SQL query instead of just adding an index?

You should rewrite a slow SQL query instead of adding an index when EXPLAIN ANALYZE reveals suboptimal execution plans caused by inefficient query logic rather than missing data access paths, ensuring that query rewrites directly address the identified performance bottlenecks.

How do I measure database query performance before and after indexing changes?

To measure database query performance before and after indexing changes, capture an initial runtime baseline using EXPLAIN ANALYZE, implement your targeted index strategy, and re-run the analysis to validate the performance improvement and confirm scalable results.