PostgreSQL Optimization Patterns

•
151
•

Optimizes PostgreSQL databases using production-grade patterns for schema design, indexing, and security based on Supabase best practices.

This skill provides a comprehensive set of PostgreSQL best practices and patterns to enhance database performance, scalability, and security. It serves as a quick reference for developers using Claude Code to select optimal index types (B-tree, GIN, BRIN), choose correct data types, and implement advanced SQL logic like Row Level Security (RLS), upserts, and cursor-based pagination. It also includes diagnostic scripts to detect anti-patterns such as missing indices on foreign keys and table bloat, making it an essential toolkit for both initial schema design and ongoing database maintenance.

主な機能

01Configuration templates for connection pooling and performance monitoring
02Comprehensive indexing cheat sheet for B-tree, GIN, and BRIN types
03Advanced SQL implementation patterns for RLS, UPSERT, and queue processing
04Automated anti-pattern detection for slow queries and missing indices
05Best practice data type recommendations for IDs, currency, and timestamps
06151 GitHub stars

ユースケース

01Troubleshooting and optimizing slow SQL queries in production environments
02Designing and implementing a scalable database schema for a new application
03Implementing fine-grained access control using Row Level Security (RLS) policies