supabase-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.
Savant verdict: Analyzed
Scanned or evaluated by Savant; not yet both passing.
Live evaluation
63overall
64quality
56compliance
67grounding
79actionability
53efficiency
Why this score may understate the skillThe live evaluation is a chat-only run: the model follows the skill's instructions but can't execute its scripts, call tools or reach the network.
- 24 reference files were too large to include in the run's context.
2 pass · 3 investigate · 4 fail across 9 cases. Jev accepted 9 of 14 LLM-drafted cases. Drafted and run by nvidia/nemotron-3-super-120b-a12b, validated and scored by jev-latest.
- I'm designing a Supabase database for an e-commerce platform. I need to optimize queries that frequently filter orders by customer_id and status. What indexes should I create for the orders table?positive case · fail
- Our Supabase application has a jobs table for background processing with multiple workers. Workers are experiencing delays when trying to claim jobs because they're blocking each other. How can we improve throughput?positive case · pass
- We're building a multi-tenant SaaS application in Supabase and need to ensure tenant data isolation. How should we implement Row Level Security to prevent tenants from accessing each other's data?positive case · investigate
- I need to optimize a query that selects user profiles with their recent activity. The query is slow but I'm not sure which columns to index.edge case · investigate
- Our Supabase database is experiencing high memory usage and occasional out-of-memory errors. We suspect it's related to connection settings but aren't sure what values to use.edge case · investigate
- We're implementing pagination for a product catalog in Supabase. The current implementation uses OFFSET but gets slow on later pages. We want to improve performance but aren't sure about the best approach.edge case · pass
- I need to write a Python script that connects to my Supabase database and performs ETL operations on the data. Can you help me write the code?negative case · fail
- Our Supabase project uses React on the frontend. We're having issues with stale data showing up in the UI. How can we implement caching strategies in our React components?negative case · fail
Safety (NVIDIA SkillSpector)
Risk score
0/100
Recommendation
CAUTION
Severity
LOW
Savant decision
Passed (low risk)
SkillSpector rated it CAUTION, but its risk score is below 20/100, so Savant's policy passes it. Its findings are still listed for review. SkillSpector 2.12.0, static analysis.
0 patterns found
Structure
- 1 referenced file isn't in the packagereferences/schema-partial-indexes.md. They may be binary, too large to catalog, or missing upstream.
- No license declaredConfirm you may reuse this skill before importing it into your repository.
SKILL.md
--- name: supabase-postgres-best-practices description: Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations. metadata: author: supabase version: "1.1.0" organization: Supabase date: January 2026 abstract: Comprehensive Postgres performance optimization guide for developers using Supabase and Postgres. Contains performance rules across 8 categories, prioritized by impact from critical (query performance, connection management) to incremental (advanced features). Each rule includes detailed explanations, incorrect vs. correct SQL examples, query plan analysis, and specific performance metrics to guide automated optimization and code generation. --- # 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: ``` references/query-missing-indexes.md references/schema-partial-indexes.md references/_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) ## References - https://www.postgresql.org/docs/current/ - https://supabase.com/docs - https://wiki.postgresql.org/wiki/Performance_Optimization - https://supabase.com/docs/guides/database/overview - https://supabase.com/docs/guides/auth/row-level-security