# Postgresql Review

> Review PostgreSQL schemas, queries, and configuration for performance and production readiness

- Skill: `erp-core-dev/postgresql-review` (Agent Skill)
- Install (CLI): `npx skillmds@latest add erp-core-dev/postgresql-review`
- Raw SKILL.md: https://api.skillmd.com/api/skills/erp-core-dev/postgresql-review/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: ERP-CORE-DEV (https://skillmd.com/u/erp-core-dev)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/erp-core-dev/postgresql-review

---


# PostgreSQL Review

Review PostgreSQL for query optimization, indexing, VACUUM, partitioning, connection pooling, and security.

## Key Checks
- EXPLAIN (ANALYZE, BUFFERS) on all non-trivial queries — flag sequential scans on large tables
- B-tree indexes on FKs/filter columns, GIN for JSONB, GiST for full-text, BRIN for append-only
- Covering indexes (INCLUDE) to eliminate heap fetches, partial indexes for selective subsets
- Unused index audit via pg_stat_user_indexes (idx_scan = 0)
- autovacuum enabled, n_dead_tup monitored, fillfactor tuned for HOT updates
- Range/list/hash partitioning with partition pruning verified in EXPLAIN
- PgBouncer in transaction mode for connection pooling
- shared_buffers 25% RAM, effective_cache_size 75%, work_mem conservative
- No SUPERUSER for app accounts, SSL enforced, RLS on multi-tenant tables

## Output
Severity-sorted: CRITICAL, HIGH, MEDIUM, LOW, PASSED.

