supabase-postgres-best-practices

Optimize Postgres queries and schemas with SQL examples and EXPLAIN guidance.

2|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/augustscl/awesome-xiawang-skills --skill supabase-postgres-best-practices-augustscl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-postgres-best-practices
Source: https://github.com/augustscl/awesome-xiawang-skills/tree/main/supabase-postgres-best-practices
Command: npx skills add https://github.com/augustscl/awesome-xiawang-skills --skill supabase-postgres-best-practices-augustscl

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill collects prioritized, actionable Postgres performance and reliability rules to help developers and DBAs diagnose slow queries, fix schema and indexing mistakes, and configure connections and maintenance safely.

Core Features & Use Cases

  • Prioritized Guidance: Eight ordered categories from critical query performance and connection management to low-impact advanced features.
  • Concrete SQL Examples: Incorrect vs correct SQL, EXPLAIN guidance, index and partitioning patterns, and connection pooling recommendations.
  • Operational Use Cases: Audit slow queries, design indexes and primary keys, tune autovacuum and timeouts, implement safe RLS policies, and prepare migration-safe constraint changes.

Quick Start

Provide a slow SQL query and schema information to receive prioritized index, query, and configuration recommendations with example SQL fixes and EXPLAIN guidance.

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, analyze execution plans using EXPLAIN guidance, apply correct indexing patterns, and tune connection pooling configurations. This provides prioritized index recommendations and concrete SQL fixes to reduce query latency.

What is the best way to configure connection pooling for Supabase Postgres?

Configuring connection pooling for Supabase Postgres involves applying specific pooling recommendations to manage database connections safely. This provides configuration rules to prevent connection exhaustion and improve application scalability under load.

How do I implement safe row-level security policies in Postgres?

Implementing safe row-level security (RLS) policies requires following specific RLS rules to avoid performance pitfalls. This offers prioritized guidance and concrete SQL examples to design secure RLS policies without degrading query performance.

When should I use partitioning instead of indexing for Postgres performance?

Partitioning is used instead of indexing when managing large tables that degrade query performance. This provides prioritized partitioning patterns and indexing rules to help you choose the correct schema design for your specific data scale.

How do I tune autovacuum and maintenance workflows in Postgres?

Tuning autovacuum and maintenance workflows involves adjusting timeout settings and vacuum configurations to maintain database reliability. This supplies operational rules to audit maintenance tasks and ensure consistent Postgres performance.