Add indexes on foreign keys and common query filters
PostgreSQL does NOT auto-index foreign keys. Queries filtering by organization_id or repository_id will full-table-scan without explicit indexes.
Why This Matters
Missing indexes on frequently-queried foreign keys cause slow queries that degrade exponentially as table size grows.
Tags
nextjssupabase
Related Rules
Catch this automatically on every PR
BeforeMerge scans your pull requests against this rule and 2+ others. Get actionable feedback before code ships.