supabase-postgres-best-practices

Provide prioritized Postgres performance optimizations and SQL rewrites for Supabase databases.

2|Updated Apr 11, 2026
One-click install
npx skills add https://github.com/PlazaCC/antes-da-tela --skill supabase-postgres-best-practices-plazacc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-postgres-best-practices
Source: https://github.com/PlazaCC/antes-da-tela/tree/main/.agents/skills/supabase-postgres-best-practices
Command: npx skills add https://github.com/PlazaCC/antes-da-tela --skill supabase-postgres-best-practices-plazacc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This guide removes ambiguity when diagnosing and fixing Postgres performance problems on Supabase by providing prioritized, actionable rules and concrete SQL rewrites that reduce query latency, connection exhaustion, and schema-level inefficiencies.

Core Features & Use Cases

  • Prioritized Rule Set: Eight categories from critical query performance and connection management to advanced features, ordered by impact.
  • Concrete Examples: For each rule, incorrect and correct SQL examples, EXPLAIN guidance, and measurable impact estimates to support automated optimization and developer reviews.
  • Operational Guidance: Best practices for connection pooling, prepared statements, RLS performance, indexing strategies, partitioning, and maintenance tasks.
  • Use Cases: Quickly identify missing indexes for slow queries, tune autovacuum and statistics, eliminate N+1 patterns, configure PgBouncer for serverless apps, and harden RLS policies with performance-conscious patterns.

Quick Start

Ask the supabase-postgres-best-practices skill to analyze a slow query or schema and return prioritized fixes including index changes, query rewrites, and configuration recommendations.

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 Supabase?

To optimize slow Postgres queries in Supabase, analyze execution plans using EXPLAIN and apply prioritized fixes like adding missing indexes, rewriting inefficient SQL, and eliminating N+1 patterns to reduce query latency.

How do I configure connection pooling for Supabase serverless applications?

Configure connection pooling for Supabase serverless applications by using PgBouncer to manage database connections, preventing connection exhaustion and ensuring stable performance under high concurrency.

Why are my Supabase Row Level Security policies causing performance issues?

Supabase Row Level Security policies cause performance issues when they execute complex subqueries per row. You can harden RLS policies by applying performance-conscious patterns and proper indexing to reduce overhead.

What is the best way to design indexes for a Postgres schema in Supabase?

The best way to design indexes for a Postgres schema in Supabase is to identify missing indexes from slow query analysis and apply targeted indexing strategies to accelerate data retrieval without over-indexing.

How do I tune autovacuum and statistics for Supabase databases?

Tune autovacuum and statistics for Supabase databases by adjusting maintenance configurations based on table size and write load, ensuring query planners receive accurate data distribution for consistent performance.