supabase-postgres-best-practices

Apply PostgreSQL performance best practices to optimize queries, schemas, and configurations.

Updated Jan 31, 2026
One-click install
npx skills add https://github.com/nghialuffy/my-skills --skill supabase-postgres-best-practices-nghialuffy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-postgres-best-practices
Source: https://github.com/nghialuffy/my-skills/tree/main/skills/supabase-postgres-best-practices
Command: npx skills add https://github.com/nghialuffy/my-skills --skill supabase-postgres-best-practices-nghialuffy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

PostgreSQL performance can be challenging to optimize without a structured, field-tested set of guidelines. This skill consolidates best practices from Supabase and Postgres into a practical framework that helps developers write, review, and tune queries, schemas, and configurations for better performance and reliability.

Core Features & Use Cases

  • Rule-based guidance across 8 priority categories (Query Performance, Connection Management, Security & RLS, Schema Design, Concurrency & Locking, Data Access Patterns, Monitoring & Diagnostics, Advanced Features).
  • Concrete, real-world SQL examples, plus references to official docs to support learning, implementation, and auditing.
  • Suitable for activities like design reviews, performance tuning sessions, migrations, and production optimizations in Supabase projects or generic Postgres deployments.

Quick Start

Review the SKILL.md and apply the Supabase Postgres best practices to optimize a given database workload.

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 PostgreSQL query performance in Supabase?

To optimize PostgreSQL query performance, apply structured best practices across query design, schema configuration, and index management. This framework provides concrete SQL examples and rules across eight priority categories to tune Supabase workloads.

What are the most important indexes to add for slow Postgres queries?

Index optimization is critical for slow Postgres queries, requiring targeted indexing strategies based on data access patterns. This guide covers schema design and query performance rules with real-world SQL examples to identify and apply the correct indexes.

Can I use these database optimization rules for generic PostgreSQL deployments?

Yes, you can use these database optimization rules for generic PostgreSQL deployments, not just Supabase projects. The guidance applies field-tested Postgres best practices for schema design, concurrency, and connection management to any database workload.

How does Row Level Security affect Supabase database performance?

Row Level Security impacts Supabase database performance by adding policy checks to query execution paths. This framework includes a dedicated Security & RLS category to ensure access control rules do not degrade query speed or lock concurrency.

What is the best way to structure PostgreSQL schemas for high concurrency?

The best way to structure PostgreSQL schemas for high concurrency involves following structured rules for schema design and locking management. This guide provides field-tested guidelines to minimize lock contention and optimize data access patterns.

Why are my Supabase database migrations causing table locks?

Supabase database migrations cause table locks when schema changes conflict with concurrency patterns. This framework provides rules for concurrency and locking to review migrations and optimize configurations, preventing production downtime.