postgres-expert

Optimize PostgreSQL queries, schema design, indexing, and database administration.

Updated Mar 13, 2026
One-click install
npx skills add https://github.com/bacoco/openfang-fork --skill postgres-expert-bacoco
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-expert
Source: https://github.com/bacoco/openfang-fork/tree/main/crates/openfang-skills/bundled/postgres-expert
Command: npx skills add https://github.com/bacoco/openfang-fork --skill postgres-expert-bacoco

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses challenges in PostgreSQL database performance, query efficiency, schema design, and operational administration, ensuring databases run optimally.

Core Features & Use Cases

  • Query Optimization: Analyzes and rewrites SQL queries for maximum efficiency using EXPLAIN ANALYZE.
  • Indexing Strategies: Recommends and implements appropriate index types (B-tree, GIN, GiST, BRIN) based on access patterns.
  • Schema Design: Guides on normalization and denormalization trade-offs for performance.
  • Database Administration: Provides advice on vacuuming, partitioning, connection pooling, and locking.
  • Use Case: A developer struggling with slow-running reports can use this Skill to identify the bottleneck query, receive an optimized version, and get recommendations for new indexes to speed up data retrieval.

Quick Start

Use the postgres-expert skill to analyze the query plan for 'SELECT * FROM users WHERE created_at > ''2023-01-01'''.

Frequently Asked Questions about postgres-expert

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

FAQPage Schema
How do I optimize slow PostgreSQL queries?

To optimize slow PostgreSQL queries, you analyze and rewrite SQL statements for maximum efficiency using EXPLAIN ANALYZE. This process identifies performance bottlenecks within the query planner and suggests structural improvements to speed up data retrieval.

What is the best way to choose PostgreSQL index types for specific access patterns?

Choosing PostgreSQL index types involves evaluating access patterns to recommend and implement appropriate structures like B-tree, GIN, GiST, or BRIN. This targeted indexing strategy directly improves database query performance and operational efficiency.

How does MVCC impact PostgreSQL administration and vacuuming?

MVCC impacts PostgreSQL administration by requiring regular vacuuming to reclaim storage and prevent transaction ID wraparound. Managing this multi-version concurrency control mechanism maintains database health and ensures consistent operational efficiency.

When should I use denormalization in PostgreSQL schema design?

You should use denormalization in PostgreSQL schema design when performance trade-offs favor faster data retrieval over strict normalization. Evaluating these structural trade-offs helps solve relational database bottlenecks and improves query speed.

Can I get advice on PostgreSQL partitioning and connection pooling?

You can get advice on PostgreSQL partitioning and connection pooling to solve operational bottlenecks and improve database administration. Implementing these techniques enhances resource management and overall relational database performance.