agency-database-optimizer

Analyze EXPLAIN ANALYZE plans to optimize PostgreSQL, MySQL, and Supabase queries.

Updated Jul 24, 2026
One-click install
npx skills add https://github.com/imMamdouhaboammar/kaku-chatgpt-harness --skill agency-database-optimizer-immamdouhaboammar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agency-database-optimizer
Source: https://github.com/imMamdouhaboammar/kaku-chatgpt-harness/tree/main/.agents/skills/engineering-database-optimizer
Command: npx skills add https://github.com/imMamdouhaboammar/kaku-chatgpt-harness --skill agency-database-optimizer-immamdouhaboammar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses database performance bottlenecks, inefficient query execution, and schema design flaws that lead to slow application response times and scaling issues.

Core Features & Use Cases

  • Query Optimization: Analyzes EXPLAIN ANALYZE plans to identify and resolve slow queries and N+1 patterns.
  • Schema & Indexing Strategy: Provides expert guidance on normalization, foreign key indexing, and partial index implementation.
  • Use Case: Use this skill to audit a slow-performing PostgreSQL query, generate an optimized JOIN structure, and create the necessary indexes to ensure sub-millisecond response times under load.

Quick Start

Analyze the provided SQL query and schema to identify performance bottlenecks and suggest an optimized execution plan.

Frequently Asked Questions about agency-database-optimizer

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

FAQPage Schema
How do I analyze EXPLAIN ANALYZE plans to fix slow PostgreSQL queries?

To fix slow PostgreSQL queries, analyze EXPLAIN ANALYZE plans to identify complex execution paths and N+1 patterns. This process targets query bottlenecks by restructuring JOINs and implementing indexing strategies for efficient data access.

What is the best way to resolve N+1 query patterns in MySQL?

The best way to resolve N+1 query patterns in MySQL is to analyze execution plans and generate optimized JOIN structures. This eliminates redundant database calls, ensuring scalable and efficient data access under heavy load.

Does this database optimization approach work with cloud-native platforms like Supabase?

Yes, this database optimization approach works with cloud-native platforms like Supabase. It applies relational database internals, execution plan analysis, and connection pooling best practices to ensure scalable performance across PostgreSQL and MySQL environments.

How do I implement partial indexes to improve database performance?

To improve database performance with partial indexes, apply schema and indexing strategies targeting foreign keys and specific query constraints. This reduces index size and accelerates query execution by focusing on relevant data subsets.

Why does my database query execution time increase under load despite proper indexing?

Database query execution time increases under load when schema design flaws or connection pooling bottlenecks exist. Analyzing execution plans and resolving N+1 patterns ensures sub-millisecond response times by optimizing data access paths.

What are the limitations of database schema normalization for query performance?

While schema normalization reduces data redundancy, it can degrade query performance by requiring complex JOINs. Balancing normalization with foreign key indexing and partial indexes is necessary to maintain efficient data retrieval.