postgres-best-practices
Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.
Imported description, not reviewed yet
This item came from its original repository and was only scanned automatically; no editor has written an Arabic description for it yet. Read its content yourself before you rely on it. This page is not indexed by search engines until it is reviewed.
Download
Install
After downloading, run the command in a terminal. unzip asks before it replaces any file that is there.
For this project
It goes in: .claude/skills/postgres-best-practices/
mkdir -p .claude/skills && unzip ~/Downloads/postgres-best-practices.zip -d .claude/skillsFor your account on the whole machine
It goes in: ~/.claude/skills/postgres-best-practices/
mkdir -p ~/.claude/skills && unzip ~/Downloads/postgres-best-practices.zip -d ~/.claude/skills
Instructions
Supabase Postgres Best Practices
Comprehensive performance optimization guide for Postgres, maintained by Supabase. Contains rules across 8 categories, prioritized by impact to guide automated query optimization and schema design.
When to Apply
Reference these guidelines when:
- Writing SQL queries or designing schemas
- Implementing indexes or query optimization
- Reviewing database performance issues
- Configuring connection pooling or scaling
- Optimizing for Postgres-specific features
- Working with Row-Level Security (RLS)
Rule Categories by Priority
| 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- |
How to Use
Read individual rule files for detailed explanations and SQL examples:
rules/query-missing-indexes.md
rules/schema-partial-indexes.md
rules/_sections.md
Each rule file contains:
- Brief explanation of why it matters
- Incorrect SQL example with explanation
- Correct SQL example with explanation
- Optional EXPLAIN output or metrics
- Additional context and references
- Supabase-specific notes (when applicable)
Full Compiled Document
For the complete guide with all rules expanded: AGENTS.md
Files
- folderrules49 KB
- _contributing.md4 KB
- _sections.md1.6 KB
- _template.md1 KB
- advanced-full-text-search.md1.4 KB
- advanced-jsonb-indexing.md1.4 KB
- conn-idle-timeout.md1.3 KB
- conn-limits.md1.3 KB
- conn-pooling.md1.3 KB
- conn-prepared-statements.md1.5 KB
- data-batch-inserts.md1.3 KB
- data-n-plus-one.md1.3 KB
- data-pagination.md1.3 KB
- data-upsert.md1.4 KB
- lock-advisory.md1.5 KB
- lock-deadlock-prevention.md1.8 KB
- lock-short-transactions.md1.3 KB
- lock-skip-locked.md1.3 KB
- monitor-explain-analyze.md1.4 KB
- monitor-pg-stat-statements.md1.4 KB
- monitor-vacuum-analyze.md1.5 KB
- query-composite-indexes.md1.4 KB
- query-covering-indexes.md1.3 KB
- query-index-types.md1.4 KB
- query-missing-indexes.md1.2 KB
- query-partial-indexes.md1.3 KB
- schema-data-types.md1.4 KB
- schema-foreign-key-indexes.md1.6 KB
- schema-lowercase-identifiers.md1.7 KB
- schema-partitioning.md1.5 KB
- schema-primary-keys.md1.8 KB
- security-privileges.md1.5 KB
- security-rls-basics.md1.3 KB
- security-rls-performance.md1.5 KB
- AGENTS.md44 KB
- LICENSE1 KB
- README.md3.1 KB
- SKILL.md1.8 KB
- metadata.json818 B
Comments (0)
No comments yet. Be the first.
Sign in to comment. Commenting comes at level 1 (Member).