database-advanced-optimization

Optimize PostgreSQL, MongoDB, and Redis performance with indexing and query tuning.

17|1|Updated Jun 8, 2025
One-click install
npx skills add https://github.com/williamzujkowski/standards --skill database-advanced-optimization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-advanced-optimization
Source: https://github.com/williamzujkowski/standards/tree/main/skills/database/advanced-optimization
Command: npx skills add https://github.com/williamzujkowski/standards --skill database-advanced-optimization

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This skill provides advanced techniques to optimize database performance, eliminating bottlenecks and ensuring your applications run at peak efficiency. It automates the process of identifying slow queries, implementing effective indexing, and configuring connection pooling, saving you countless hours of manual tuning.

Core Features & Use Cases

  • Query Tuning: Guides on rewriting inefficient SQL queries for faster execution.
  • Indexing Strategies: Teaches how to design and implement optimal indexes for various workloads.
  • Connection Pooling: Provides configurations and scripts for tools like PgBouncer to manage database connections efficiently.
  • Use Case: Analyze a slow PostgreSQL query using the provided profiling script, then use the skill to suggest optimal indexes and query rewrites to drastically improve its performance.

Quick Start

Generate a PostgreSQL query optimization script, including common indexing and query rewrite suggestions.

Frequently Asked Questions about database-advanced-optimization

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

FAQPage Schema
How do I identify and fix slow database queries in PostgreSQL?

Slow query identification uses EXPLAIN ANALYZE to reveal execution plans and bottlenecks. This skill guides you through query plan analysis, rewriting inefficient SQL, and implementing optimal indexes—B-tree, GIN, or GiST types—to drastically reduce execution time and improve application performance.

What indexing strategies work best for different database workloads?

Indexing strategies depend on query patterns and data distribution. This skill teaches you to design and implement index types—B-tree for range queries, GIN for full-text search, GiST for spatial data—across PostgreSQL, MongoDB, and Redis to accelerate reads while minimizing write overhead.

How do I set up connection pooling to handle database load?

Connection pooling manages concurrent database connections efficiently using tools like PgBouncer. This skill provides configuration templates and automation scripts to pool connections across SQL and NoSQL stores, reducing connection overhead and enabling production-grade deployments at scale.

Can I optimize MongoDB and Redis performance the same way as PostgreSQL?

While core principles differ, this skill addresses optimization across PostgreSQL, MongoDB, and Redis with platform-specific techniques. It covers indexing strategies, query optimization, caching approaches, and sharding/replication planning tailored to each database type's architecture.

What's the difference between VACUUM tuning and autovacuum configuration?

VACUUM reclaims storage and prevents transaction ID wraparound; autovacuum automates this process. This skill covers both manual VACUUM tuning and autovacuum parameter configuration to maintain PostgreSQL performance without manual intervention in production environments.

How do I monitor and profile database performance in production?

Database monitoring uses profiling scripts and dashboards to track query execution, connection counts, and resource usage. This skill provides monitoring and profiling tooling, configuration templates, and automation scripts to identify bottlenecks and optimize production-grade deployments continuously.