PostgreSQL Best Practices & Patterns

•
172k
•

Optimizes PostgreSQL database performance and security through expert schema design, indexing strategies, and RLS policy implementation.

The PostgreSQL Patterns skill provides a comprehensive toolkit for building and maintaining high-performance database architectures. Based on industry-standard Supabase best practices, it guides Claude in selecting the correct index types (GIN, BRIN, B-tree), choosing scalable data types, and implementing advanced SQL patterns like cursor-based pagination and UPSERTs. It also includes diagnostic tools for identifying anti-patterns, such as unindexed foreign keys and table bloat, ensuring your database remains efficient as it scales.

Key Features

01Advanced indexing cheat sheets for complex query patterns
02Performance-optimized Row Level Security (RLS) policy templates
03172,007 GitHub stars
04Scalable data type recommendations for IDs, timestamps, and currency
05Anti-pattern detection for slow queries and unindexed foreign keys
06Ready-to-use SQL patterns for job queues and cursor-based pagination

Use Cases

01Designing scalable and secure database schemas for new backend services
02Troubleshooting and optimizing slow SQL queries in production environments
03Implementing robust multi-tenant security using Row Level Security