database-query-optimizer

Analyze EXPLAIN plans and recommend indexes for PostgreSQL, MySQL, and MongoDB.

6|2|Updated Oct 31, 2025
One-click install
npx skills add https://github.com/Dexploarer/claudius-skills --skill database-query-optimizer-dexploarer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-query-optimizer
Source: https://github.com/Dexploarer/claudius-skills/tree/main/examples/intermediate/performance-skills/database-query-optimizer
Command: npx skills add https://github.com/Dexploarer/claudius-skills --skill database-query-optimizer-dexploarer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It interprets EXPLAIN plans, suggests indexes, and detects N+1 problems to improve query performance.

Core Features & Use Cases

  • Explain plan analysis: PostgreSQL, MySQL
  • Index suggestions: For common query patterns
  • N+1 detection: Discovery and mitigation

Quick Start

Provide an EXPLAIN plan and get optimization recommendations.

Frequently Asked Questions about database-query-optimizer

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

FAQPage Schema
How do I optimize slow database queries using EXPLAIN plans?

EXPLAIN plans show query execution details; analyze the output to identify sequential scans, missing indexes, and high costs. This Skill parses PostgreSQL and MySQL EXPLAIN output to pinpoint bottlenecks and recommend specific index strategies to reduce execution time.

What is N+1 query problem and how do I detect it?

N+1 occurs when a loop executes one query per row instead of joining data upfront, multiplying database round trips. This Skill identifies N+1 patterns in your queries and provides rewrite guidance to fetch related data in fewer queries.

What types of indexes should I create to speed up queries?

Index recommendations depend on query patterns and data selectivity. This Skill analyzes your queries and suggests standard, partial, covering, and functional indexes tailored to your PostgreSQL, MySQL, or MongoDB workload.

Can I use query optimization with MongoDB?

Yes. This Skill analyzes EXPLAIN plans and detects N+1 patterns across PostgreSQL, MySQL, and MongoDB, recommending indexes appropriate to each database engine's capabilities.

How do I start optimizing my queries with an EXPLAIN plan?

Provide your database's EXPLAIN output for the slow query. This Skill parses the plan, identifies performance issues like missing indexes or inefficient joins, and delivers concrete rewrite and indexing recommendations.

What's the difference between index recommendations and query rewrites?

Index recommendations add database structures to accelerate existing queries; query rewrites restructure the SQL logic itself. This Skill provides both—suggesting indexes and rewrite patterns to eliminate N+1 and join inefficiencies.