supabase-performance-tuning
SKILL.md
Supabase Performance Tuning
Overview
Systematically improve Supabase query and database performance across three layers: PostgreSQL engine (indexes, query plans, materialized views), Supabase infrastructure (Supavisor connection pooling, Edge Functions, read replicas), and client SDK patterns (column selection, pagination, RPC functions). Every technique here is measurable — run EXPLAIN ANALYZE before and after to confirm the improvement.
Prerequisites
- Supabase project (local or hosted) with
@supabase/supabase-jsv2+ installed - Supabase CLI installed (
npx supabase --versionto verify) - Access to the SQL Editor in the Supabase Dashboard or a direct Postgres connection
pg_stat_statementsextension enabled (Step 1 covers this)
Instructions
Step 1: Diagnose — Find What Is Slow
Start every performance effort with data. Enable pg_stat_statements and run the Supabase CLI diagnostics to identify bottlenecks before optimizing.