database-optimizer

Analyze execution plans and tune queries, indexes, and caching across PostgreSQL, MySQL, and SQL Server.

Updated Jan 26, 2026
One-click install
npx skills add https://github.com/erikhoward/agent-rules --skill database-optimizer-erikhoward
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-optimizer
Source: https://github.com/erikhoward/agent-rules/tree/main/claude/skills/sql-optimization-patterns
Command: npx skills add https://github.com/erikhoward/agent-rules --skill database-optimizer-erikhoward

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams overcome database performance bottlenecks by providing a structured approach to tuning queries, indexes, caching, and scalability planning.

Core Features & Use Cases

  • Advanced Query Optimization: Execution plan analysis, query rewriting, plan caching, cross-database tuning for PostgreSQL, MySQL, SQL Server, Oracle, and NoSQL patterns.
  • Modern Indexing Strategies: B-tree, Hash, GiST, GIN, BRIN indexes; composite and partial indexes; indexing for JSON/JSONB; maintenance guidelines.
  • Performance Analysis & Monitoring: Query profiling, metrics dashboards, anomaly detection, and proactive performance monitoring.
  • N+1 Query Resolution: Detection, eager loading, batching, and ORM optimization techniques.
  • Advanced Caching Architectures: Multi-tier caching strategies, cache invalidation, and cache warmth/planning.
  • Database Scaling & Partitioning: Horizontal and vertical partitioning, sharding strategies, read/write scaling, and cloud auto-scaling.
  • Schema Design & Migration: Normalization vs denormalization, migration strategies, version control, and data type considerations.

Quick Start

Analyze your current workload, identify the top slow queries, and propose a comprehensive optimization plan covering indexing, caching, and query rewrites.

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 across multiple database environments?

Database query optimization is achieved through execution plan analysis, query rewriting, and cross-database tuning for PostgreSQL, MySQL, and SQL Server. It resolves performance bottlenecks by identifying inefficiencies and applying targeted query rewrites.

What is the best way to resolve N+1 query issues in my application?

N+1 query resolution is handled through detection, eager loading, batching, and ORM optimization techniques. It eliminates redundant database calls by aggregating data access patterns into efficient batched queries.

When do I need modern indexing strategies like GIN or BRIN for database performance tuning?

Modern indexing strategies like GIN, BRIN, Hash, and GiST are needed for specialized workloads such as JSONB indexing or large sequential datasets. They improve database performance tuning by matching index structures to specific query patterns.

Does database optimization support horizontal partitioning and sharding for cloud auto-scaling?

Yes, database optimization supports horizontal and vertical partitioning, sharding strategies, read/write scaling, and cloud auto-scaling. It enables database scaling by distributing workloads across multiple nodes to handle increased traffic.

How do I implement multi-tier caching architectures and cache invalidation for my database?

Implement multi-tier caching architectures by defining cache invalidation rules, cache warmth planning, and layered data storage. This reduces database load by serving frequent read requests directly from optimized memory layers.