postgres-best-practices
SKILL.md
Postgres Best Practices
Postgres performance optimization guidelines from Supabase, prioritized by impact.
Categories (Priority Order)
1. Query Performance (Critical)
- Use EXPLAIN ANALYZE to understand query plans
- Add indexes on frequently queried columns (WHERE, JOIN, ORDER BY)
- **Avoid SELECT *** - specify only needed columns
- Use LIMIT for large result sets
- Optimize JOINs - ensure foreign keys are indexed
- Use prepared statements (Supabase client does this automatically)
- Batch operations when possible