supabase-postgres-best-practices

Provide PostgreSQL optimization rules with SQL examples and performance metrics.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/magisph/rv-adv --skill supabase-postgres-best-practices-magisph
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-postgres-best-practices
Source: https://github.com/magisph/rv-adv/tree/main/.agents/skills/supabase-postgres-best-practices
Command: npx skills add https://github.com/magisph/rv-adv --skill supabase-postgres-best-practices-magisph

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidelines and best practices for optimizing PostgreSQL database performance, helping developers write more efficient queries, design better schemas, and manage connections effectively.

Core Features & Use Cases

  • Query Optimization: Learn how to add missing indexes, use composite indexes, and choose the right index types.
  • Schema Design: Understand best practices for data types, constraints, and partitioning.
  • Connection Management: Optimize connection pooling and timeouts to prevent resource exhaustion.
  • Use Case: A developer is experiencing slow query times on their Supabase project. They can use this Skill to identify missing indexes or inefficient query patterns and receive actionable advice to improve performance.

Quick Start

Use the supabase-postgres-best-practices skill to find guidance on optimizing slow queries.

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

To optimize slow PostgreSQL queries, you need to identify missing indexes and rewrite inefficient query patterns. This Skill provides prioritized rules with incorrect versus correct SQL examples to guide query optimization and improve database performance.

What are the best practices for PostgreSQL schema design and data types?

PostgreSQL schema design best practices involve selecting appropriate data types, applying constraints, and implementing partitioning. These guidelines help structure your database efficiently to prevent performance bottlenecks as your data grows.

How does connection pooling work for PostgreSQL performance optimization?

Connection pooling optimizes PostgreSQL performance by managing database connections and timeouts to prevent resource exhaustion. Configuring pooling properly ensures your application handles concurrent requests without overwhelming the database server.

When should I use composite indexes in PostgreSQL?

You should use composite indexes in PostgreSQL when queries filter or sort on multiple columns simultaneously. This Skill details how to choose the right index types and add missing indexes to significantly speed up complex query execution.

Does this Skill work for general Postgres databases or only Supabase?

These PostgreSQL performance optimization guidelines are maintained by Supabase but apply to general Postgres databases. The rules cover universal concepts like query optimization, schema design, and connection management applicable across environments.

Why is my Supabase database experiencing resource exhaustion and slow response times?

Supabase database resource exhaustion often stems from inefficient SQL queries, missing indexes, or unoptimized connection management. Applying targeted performance rules can identify problematic patterns and provide actionable advice to resolve slowdowns.