postgres-expert

Analyze PostgreSQL query plans with EXPLAIN and recommend indexing strategies.

1|Updated Mar 2, 2026
One-click install
npx skills add https://github.com/0xMerl99/FangAI --skill postgres-expert-0xmerl99
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-expert
Source: https://github.com/0xMerl99/FangAI/tree/main/crates/openfang-skills/bundled/postgres-expert
Command: npx skills add https://github.com/0xMerl99/FangAI --skill postgres-expert-0xmerl99

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the challenges of optimizing PostgreSQL database performance, ensuring efficient query execution, effective indexing, and sound database administration practices.

Core Features & Use Cases

  • Query Optimization: Analyzes query plans and suggests improvements for speed and resource usage.
  • Indexing Strategies: Recommends appropriate index types (B-tree, GIN, GiST, BRIN) and creation methods (covering, partial) based on access patterns.
  • Schema Design: Guides on normalization and denormalization trade-offs for performance.
  • Database Administration: Provides advice on vacuuming, analyzing, and managing connections.
  • Use Case: A developer struggling with slow-running reports can use this Skill to identify bottlenecks and implement optimized queries and indexes.

Quick Start

Analyze the query plan for the following SQL statement: EXPLAIN (ANALYZE, BUFFERS) 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 PostgreSQL query performance using EXPLAIN ANALYZE?

PostgreSQL query optimization involves analyzing execution plans with EXPLAIN (ANALYZE, BUFFERS) to identify bottlenecks, then applying indexing strategies and schema adjustments to reduce resource usage and improve speed.

What is the best way to choose PostgreSQL index types like GIN or GiST?

Selecting PostgreSQL index types depends on access patterns: B-tree suits standard lookups, GIN and GiST fit full-text search and geometric data, and BRIN minimizes storage overhead for large sorted tables.

When should I use partial or covering indexes in PostgreSQL?

Use partial indexes in PostgreSQL when queries consistently filter on a specific subset of rows, and apply covering indexes to include extra columns in the index, avoiding main table lookups entirely.

How does vacuuming affect PostgreSQL database administration and performance?

Vacuuming reclaims storage occupied by dead tuples in PostgreSQL, preventing transaction ID wraparound and table bloat, maintaining consistent query performance and overall database health.

How do I design a PostgreSQL schema for better performance?

Designing a PostgreSQL schema for performance requires evaluating normalization and denormalization trade-offs based on access patterns, ensuring efficient query execution and effective indexing strategies.