Optimize Supabase Postgres Performance
Supabase's prioritized Postgres performance guide: query, connection, RLS, schema, locking, and monitoring rules.
Why it matters
Enhance your Supabase Postgres database performance and security with a comprehensive guide to best practices. This asset provides prioritized rules for query optimization, schema design, and connection management.
Outcomes
What it gets done
Optimize SQL queries for critical performance gains.
Design efficient and secure database schemas.
Implement best practices for connection pooling and scaling.
Strengthen Row-Level Security (RLS) configurations.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-postgres-best-practices | bash Overview
Supabase Postgres Best Practices
Provides Supabase's prioritized Postgres performance guide covering query, connection, RLS, schema, locking, and monitoring rules with SQL examples. Use when writing Postgres queries, designing schemas, optimizing connections, or working with Row-Level Security.
What it does
Provides a comprehensive Postgres performance optimization guide maintained by Supabase, organizing rules across eight categories prioritized by impact to guide query optimization and schema design.
When to use - and when NOT to
Reference this skill when writing SQL queries or designing schemas, implementing indexes or query optimization, reviewing database performance issues, configuring connection pooling or scaling, optimizing Postgres-specific features, or working with Row-Level Security (RLS). Not a fit for non-Postgres databases or for application-layer performance issues unrelated to the database.
Inputs and outputs
Organizes rules into eight prioritized categories, each with a rule-file prefix: Query Performance (query-, critical priority), Connection Management (conn-, critical), Security & RLS (security-, critical), Schema Design (schema-, high), Concurrency & Locking (lock-, medium-high), Data Access Patterns (data-, medium), Monitoring & Diagnostics (monitor-, low-medium), and Advanced Features (advanced-, low).
Individual rule files (e.g. rules/query-missing-indexes.md, rules/schema-partial-indexes.md) each contain a brief explanation of why the rule matters, an incorrect SQL example with explanation, a correct SQL example with explanation, optional EXPLAIN output or performance metrics, additional context/references, and Supabase-specific notes where applicable. A full compiled document (AGENTS.md) expands all rules into one complete reference guide.
Who it's for
Developers and DBAs writing Postgres queries, designing schemas, or tuning connection pooling and RLS policies who need a prioritized, example-driven rule set rather than generic database performance advice.
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.