2.8 KiB
2.8 KiB
supabase-postgres-best-practices
Note:
CLAUDE.mdis a symlink to this file.
Overview
Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.
Structure
supabase-postgres-best-practices/
SKILL.md # Main skill file - read this first
AGENTS.md # This navigation guide
CLAUDE.md # Symlink to AGENTS.md
references/ # Detailed reference files
Usage
- Read
SKILL.mdfor the main skill instructions - Browse
references/for detailed documentation on specific topics - Reference files are loaded on-demand - read only what you need
Reference Categories
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Query Performance | CRITICAL | query- |
| 2 | Connection Management | CRITICAL | conn- |
| 3 | Security & RLS | CRITICAL | security- |
| 4 | Schema Design | HIGH | schema- |
| 5 | Concurrency & Locking | MEDIUM-HIGH | lock- |
| 6 | Data Access Patterns | MEDIUM | data- |
| 7 | Monitoring & Diagnostics | LOW-MEDIUM | monitor- |
| 8 | Advanced Features | LOW | advanced- |
Reference files are named {prefix}-{topic}.md (e.g., query-missing-indexes.md).
Available References
Advanced Features (advanced-):
references/advanced-full-text-search.mdreferences/advanced-jsonb-indexing.md
Connection Management (conn-):
references/conn-idle-timeout.mdreferences/conn-limits.mdreferences/conn-pooling.mdreferences/conn-prepared-statements.md
Data Access Patterns (data-):
references/data-batch-inserts.mdreferences/data-n-plus-one.mdreferences/data-pagination.mdreferences/data-upsert.md
Concurrency & Locking (lock-):
references/lock-advisory.mdreferences/lock-deadlock-prevention.mdreferences/lock-short-transactions.mdreferences/lock-skip-locked.md
Monitoring & Diagnostics (monitor-):
references/monitor-explain-analyze.mdreferences/monitor-pg-stat-statements.mdreferences/monitor-vacuum-analyze.md
Query Performance (query-):
references/query-composite-indexes.mdreferences/query-covering-indexes.mdreferences/query-index-types.mdreferences/query-missing-indexes.mdreferences/query-partial-indexes.md
Schema Design (schema-):
references/schema-data-types.mdreferences/schema-foreign-key-indexes.mdreferences/schema-lowercase-identifiers.mdreferences/schema-partitioning.mdreferences/schema-primary-keys.md
Security & RLS (security-):
references/security-privileges.mdreferences/security-rls-basics.mdreferences/security-rls-performance.md
30 reference files across 8 categories