supabase-postgres-best-practices

Optimize Supabase Postgres queries and schemas with SQL rewrites and EXPLAIN-based diagnosis.

1|Updated Apr 4, 2026
One-click install
npx skills add https://github.com/lagarcess/argus --skill supabase-postgres-best-practices-lagarcess
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-postgres-best-practices
Source: https://github.com/lagarcess/argus/tree/main/.agent/skills/supabase-postgres-best-practices
Command: npx skills add https://github.com/lagarcess/argus --skill supabase-postgres-best-practices-lagarcess

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill consolidates Supabase-curated Postgres performance and reliability rules into actionable guidance so teams can fix slow queries, connection exhaustion, insecure RLS, and costly schema mistakes without guesswork.

Core Features & Use Cases

  • Query performance diagnosis and fixes: Identify missing or wrong index patterns, recommend composite/partial/covering indexes and provide EXPLAIN-based reasoning.
  • Connection and pooling guidance: Recommend connection limits, idle timeouts, and pooler configurations for serverless and high-concurrency apps.
  • Security and schema hardening: Enforce RLS patterns safely, add constraints in migrations without downtime, and index foreign keys.
  • Real-world example: For a payments system experiencing slow order lookups and connection spikes, use this Skill to produce a prioritized plan of index additions, partitioning, pooler tuning, and RLS optimizations with estimated impact.

Quick Start

Analyze a slow SELECT on the orders table and produce a prioritized remediation plan with exact SQL rewrites, index suggestions, connection-pooling settings, and an estimated performance impact.

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 fix slow Postgres queries in Supabase?

Fix slow Postgres queries by using EXPLAIN-based diagnosis to identify missing indexes and rewrite SQL. You get concrete index recommendations, query tuning, and quantified impact estimates to reduce resource waste.

What's the best way to configure connection pooling for serverless Supabase apps?

Configure connection pooling by setting appropriate connection limits, idle timeouts, and pooler configurations. This prevents connection exhaustion and ensures reliable database access during high-concurrency serverless workloads.

How do I enforce row-level security safely in Supabase?

Enforce row-level security safely by applying secure RLS patterns that prevent insecure data access. The Skill provides schema hardening guidance to ensure your RLS policies protect data without introducing vulnerabilities.

Can I add constraints to a Postgres schema without downtime?

Yes, you can add constraints without downtime using migration-safe schema changes. The Skill guides you through adding constraints and indexing foreign keys safely to avoid locking issues during deployments.

When should I use partitioning for Supabase Postgres tables?

Use partitioning for large tables experiencing slow queries and resource waste. The Skill includes partitioning recommendations as part of a prioritized remediation plan to improve query performance and manageability.

How do I diagnose Postgres query performance issues using EXPLAIN?

Diagnose query performance issues by analyzing EXPLAIN output to identify missing or wrong index patterns. The Skill provides EXPLAIN-based reasoning and recommends composite, partial, or covering indexes to optimize execution plans.