database-optimizer

Analyze slow queries and execution plans to optimize database performance.

Updated Apr 27, 2026
One-click install
npx skills add https://github.com/Tnemo65/template --skill database-optimizer-tnemo65
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-optimizer
Source: https://github.com/Tnemo65/template/tree/main/.cursor/skills/02-data-engineering/database-optimizer
Command: npx skills add https://github.com/Tnemo65/template --skill database-optimizer-tnemo65

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps database engineers diagnose and alleviate slow queries by analyzing execution plans, bottlenecks, and system metrics, and then applying indexing and configuration improvements to achieve sub-second response times.

Core Features & Use Cases

  • Execution plan analysis and bottleneck identification across PostgreSQL, MySQL, and other engines.
  • Index strategy design (covering, partial, and expression indexes) and query rewrite for performance.
  • Performance monitoring and validation, including baseline measurement, regression checks, and reproducibility reports.
  • Real-world use case: optimize a reporting workload with large JOINs and frequent aggregates to cut latency from hundreds of ms to tens of ms.

Quick Start

Analyze a slow-running workload and apply indexing and configuration tuning to achieve sub-second response times.

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 database queries and analyze execution plans?

To optimize slow database queries, you analyze execution plans to identify bottlenecks, apply indexing strategies, and tune configurations. This process targets sub-second response times by rewriting queries and validating performance through monitoring metrics.

Does database query optimization work with both PostgreSQL and MySQL?

Yes, database query optimization works with PostgreSQL, MySQL, and other engines. It analyzes execution plans across multiple systems to identify bottlenecks and apply engine-specific indexing and configuration adjustments for production workloads.

What's the best way to design indexes for queries with large JOINs and frequent aggregates?

The best way to design indexes for complex JOINs is applying covering, partial, and expression indexes. This strategy optimizes reporting workloads by reducing latency from hundreds of milliseconds to tens of milliseconds.

How do I monitor database performance and verify query optimizations?

You monitor database performance by establishing baseline measurements, running regression checks, and generating reproducibility reports. This verification ensures optimized queries maintain sub-second response times under production workloads.

Why are my database queries slow and how do execution plans help?

Database queries are slow due to bottlenecks identified within execution plans. Analyzing these plans reveals missing indexes or inefficient joins, allowing you to apply targeted configuration tuning and query rewrites to achieve sub-second response times.