postgresql

Diagnose and optimize PostgreSQL schemas, queries, and maintenance for production deployments.

3|2|Updated Dec 26, 2025
One-click install
npx skills add https://github.com/muzhicaomingwang/ai-ideas --skill postgresql-muzhicaomingwang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgresql
Source: https://github.com/muzhicaomingwang/ai-ideas/tree/main/.project/ai/DBA/skills/PostgreSQL
Command: npx skills add https://github.com/muzhicaomingwang/ai-ideas --skill postgresql-muzhicaomingwang

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PostgreSQL DBAs and engineers often struggle with diagnosing slow queries, designing robust schemas, and maintaining healthy production deployments. This skill provides structured guidance for schema design, indexing, query tuning, maintenance, and safe migrations to keep PostgreSQL performant and reliable.

Core Features & Use Cases

  • Schema design review: primary keys, data types, constraints, and JSONB considerations for stable schemas.
  • Indexing and query tuning: EXPLAIN/ANALYZE analysis, appropriate index strategies, and maintenance practices.
  • Operations & maintenance: autovacuum tuning, partitioning, backups/ replication, and safe migration planning for production systems.
  • Use Case: diagnose a slow report query, design a suitable index, and plan a zero-downtime migration.

Quick Start

Run a design review on your current schema and then execute EXPLAIN ANALYZE on your slow query to identify bottlenecks.

Frequently Asked Questions about postgresql

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

FAQPage Schema
How do I diagnose a slow PostgreSQL query in production?

Diagnose a slow PostgreSQL query by running EXPLAIN ANALYZE to identify execution bottlenecks, then review schema constraints and index strategies to optimize the query plan.

What is the best way to design indexes for PostgreSQL performance tuning?

PostgreSQL performance tuning requires analyzing EXPLAIN plans and workload characteristics to implement appropriate index strategies, ensuring stable schemas and optimized query execution.

When do I need to tune autovacuum settings for PostgreSQL maintenance?

Tune autovacuum settings for PostgreSQL maintenance when production deployments exhibit bloat or transaction ID wraparound risks, ensuring healthy operations and reliable database performance.

Can I plan a zero-downtime migration for a production PostgreSQL database?

Plan a zero-downtime PostgreSQL migration by enforcing explicit safety constraints, workload characterization, and deployment mode checks to assess risks and ensure safe schema changes.

How does partitioning improve PostgreSQL maintenance and query performance?

Partitioning improves PostgreSQL maintenance by isolating data management tasks like vacuuming and backups, while enhancing query performance through targeted partition pruning.

What should I consider for PostgreSQL schema design using JSONB data types?

PostgreSQL schema design with JSONB requires evaluating constraints, primary keys, and data types to ensure stable schemas that support robust production deployments and efficient indexing.