supabase-postgres-best-practices

Identify and apply Postgres performance best practices for Supabase queries and schemas.

1|Updated Nov 26, 2025
One-click install
npx skills add https://github.com/slavochek2/claritypledge --skill supabase-postgres-best-practices-slavochek2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-postgres-best-practices
Source: https://github.com/slavochek2/claritypledge/tree/main/.claude/commands/supabase-postgres-best-practices
Command: npx skills add https://github.com/slavochek2/claritypledge --skill supabase-postgres-best-practices-slavochek2

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Postgres performance and reliability challenges in Supabase deployments are common as data scales. This Skill provides a structured set of best-practice guidance to optimize queries, schemas, and operating configurations so teams can maintain fast, predictable database behavior.

Core Features & Use Cases

  • Query optimization guidance covering indexing, statistics, partitioning, and query planning to reduce latency.
  • Schema design & maintenance tips including primary key strategies, data types, foreign key indexing, and Row-Level Security (RLS) performance considerations.
  • Operational best practices for connections, pooling, vacuum/analyze maintenance, and monitoring with pg_stat_statements to identify hot queries.
  • Use cases include speeding up large analytic workloads, preparing scalable multi-tenant schemas, and reviewing performance during migrations.

Quick Start

Review the compiled rules in AGENTS.md and begin applying prioritized guidelines to your Postgres setup.

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

Supabase RLS performance can be optimized by reviewing Row-Level Security configurations alongside your indexing strategy. The Skill provides best-practice rules to ensure RLS policies do not degrade query latency at scale.

What is the best way to maintain Postgres vacuum and analyze operations?

The best way to maintain Postgres vacuum and analyze operations is by following operational best practices integrated with pg_stat_statements monitoring. The Skill outlines maintenance rules to identify hot queries and maintain predictable database behavior.

When do I need table partitioning for large Supabase analytic workloads?

Table partitioning is needed for large Supabase analytic workloads experiencing latency or scaling bottlenecks. The Skill provides best-practice guidance on partitioning strategies to prepare scalable schemas and maintain fast query performance.

Does this Postgres optimization guidance apply to multi-tenant database schemas?

Yes, this Postgres optimization guidance applies to multi-tenant database schemas. The Skill includes best practices for schema design, primary key strategies, and connection pooling specifically tailored for scalable multi-tenant deployments.

Why are my Supabase Postgres indexes not improving query performance?

Supabase Postgres indexes may not improve performance if statistics are outdated or foreign key indexing is misconfigured. The Skill provides rule-based guidance to review planning, statistics, and indexing strategies to resolve these issues.