supabase-postgres-best-practices

Identifies and applies Postgres performance best practices to optimize queries, schemas, and configurations for Supabase projects.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/dev-juantag/formulario-identificacion-aps --skill supabase-postgres-best-practices-dev-juantag
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-postgres-best-practices
Source: https://github.com/dev-juantag/formulario-identificacion-aps/tree/main/.agents/skills/supabase-postgres-best-practices
Command: npx skills add https://github.com/dev-juantag/formulario-identificacion-aps --skill supabase-postgres-best-practices-dev-juantag

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Postgres performance issues, including slow queries, bloated indexes, and suboptimal schema designs, are a major cost and reliability risk for applications. This skill provides a structured, vendor-neutral playbook of best-practice patterns and concrete examples to optimize Postgres in Supabase environments.

Core Features & Use Cases

  • Eight priority-driven rule categories (Query Performance, Connection Management, Security & RLS, Schema Design, Concurrency & Locking, Data Access Patterns, Monitoring & Diagnostics, Advanced Features) with clear impact guidance.
  • Concrete incorrect-vs-correct SQL examples, performance metrics, and guardrails to drive automated tuning and code generation.
  • Real-world use cases include optimizing queries and indexes, partitioning large tables, tuning autovacuum, enforcing Row Level Security securely, and maintaining statistics for stable plans.

Quick Start

Review the references and apply the sample optimization patterns to your Postgres setup in a real project.

Frequently Asked Questions about supabase-postgres-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize slow Postgres queries in a Supabase project?

Improve Postgres query performance by applying targeted indexing, schema design adjustments, and connection management rules. This skill provides structured SQL examples and metrics to guide automated query tuning for Supabase environments.

What is the best way to implement Row Level Security (RLS) without hurting database performance?

Secure Row Level Security (RLS) requires applying specific guardrails to prevent query plan degradation. This skill provides best-practice SQL examples to enforce RLS policies while maintaining optimal Postgres performance.

How do I configure autovacuum and partitioning for large Postgres tables?

Tune autovacuum and table partitioning by applying advanced Postgres maintenance patterns. This skill aggregates best practices for managing large tables and maintaining statistics for stable query plans.

Can I use these Postgres best practices for database schemas outside of Supabase?

These Postgres best practices are vendor-neutral rules supporting standard schema design and concurrency management. While structured for Supabase, the SQL examples and performance metrics apply to general Postgres optimization.

Why does my Postgres database have bloated indexes and unstable query plans?

Bloated indexes and unstable query plans stem from suboptimal schema designs and outdated statistics. This skill provides monitoring patterns and autovacuum tuning rules to resolve these Postgres reliability risks.