postgres-pro

Convert PostgreSQL EXPLAIN ANALYZE output into concrete tuning actions.

1|Updated May 16, 2026
One-click install
npx skills add https://github.com/enigmaicon-eng/AI-Enterprise-OS --skill postgres-pro-enigmaicon-eng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-pro
Source: https://github.com/enigmaicon-eng/AI-Enterprise-OS/tree/main/examples/claude-skills/skills/postgres-pro
Command: npx skills add https://github.com/enigmaicon-eng/AI-Enterprise-OS --skill postgres-pro-enigmaicon-eng

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill solves slow PostgreSQL performance, brittle query plans, and operational risk by guiding you through diagnosing bottlenecks and applying targeted fixes with measurable verification.

Core Features & Use Cases

  • EXPLAIN-driven query tuning: Diagnose planner/execution gaps using EXPLAIN (ANALYZE, BUFFERS) and interpret common plan issues (e.g., Seq Scan on large tables, inefficient joins).
  • Indexing and JSONB optimization: Design the right index types for your workload, including GIN/GiST/B-tree choices and JSONB containment/indexing patterns.
  • Replication, monitoring, and maintenance: Configure streaming/logical replication, monitor health via pg_stat views, and maintain performance with VACUUM/ANALYZE and bloat management.

Quick Start

Use the postgres-pro skill to analyze a slow query using EXPLAIN (ANALYZE, BUFFERS), recommend an index, and verify the improvement on the same query.

Frequently Asked Questions about postgres-pro

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

FAQPage Schema
How do I optimize slow PostgreSQL queries using EXPLAIN ANALYZE?

PostgreSQL query optimization requires running EXPLAIN (ANALYZE, BUFFERS) to expose execution bottlenecks like Seq Scans or inefficient joins. You convert this evidence into targeted fixes, such as adding specific index types or rewriting query structures, then verify improvements by re-running the same query.

What is the best index type for PostgreSQL JSONB containment queries?

JSONB indexing for containment queries typically uses GIN indexes to efficiently search document structures. You design indexing strategies by evaluating workload patterns against GIN, GiST, and B-tree options to ensure the database planner selects index scans over sequential scans for JSON data.

How do I configure PostgreSQL streaming replication and monitor replication lag?

PostgreSQL streaming replication configuration involves setting up primary and standby nodes, then monitoring operational health using pg_stat views. You track replication lag and maintenance correctness to ensure standby nodes stay synchronized without introducing performance degradation.

When should I run VACUUM and ANALYZE for PostgreSQL maintenance?

VACUUM and ANALYZE maintenance prevents table bloat and ensures planner statistics remain accurate for query optimization. You schedule these routines based on write workload intensity and monitor pg_stat views to verify dead tuple cleanup and statistical correctness.

Do I need to use CREATE INDEX CONCURRENTLY to avoid locking production PostgreSQL tables?

CREATE INDEX CONCURRENTLY is required for safe production PostgreSQL index creation because it avoids blocking writes. You verify index effectiveness before and after deployment to ensure the new index is actually used by the query planner without disrupting application availability.