What problem does it solve?
Help developers and DBAs stop performance regressions, misdesigned schemas, and security mistakes by providing targeted PostgreSQL patterns for query optimization, indexing, data typing, and row-level security guidance.
Core Features & Use Cases
- Index guidance: Recommend B-tree, GIN, BRIN, composite, partial, and covering indexes and when to use each.
- Schema and type guidance: Advise correct column types for IDs, timestamps, money, and flags to avoid common inefficiencies.
- Performance troubleshooting: Provide queries and checks to find slow statements, unindexed foreign keys, and table bloat using pg_stat_statements and system catalogs.
- Concurrency and queue patterns: Offer patterns for safe queue processing, cursor pagination, and upsert semantics.
- Security and RLS: Suggest secure Row Level Security policies and secure schema defaults and configuration recommendations for connection and timeout limits.
Quick Start
Ask postgres-patterns to review a slow SQL query and recommend the optimal index, schema tweak, and configuration change to improve performance.