supabase-postgres-best-practices

Review Postgres queries and schemas for performance optimization.

Updated Mar 1, 2026
One-click install
npx skills add https://github.com/Plutonian-coder/AI-hms --skill supabase-postgres-best-practices-plutonian-coder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-postgres-best-practices
Source: https://github.com/Plutonian-coder/AI-hms/tree/main/.continue/skills/supabase-postgres-best-practices
Command: npx skills add https://github.com/Plutonian-coder/AI-hms --skill supabase-postgres-best-practices-plutonian-coder

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Postgres performance issues like slow queries, connection exhaustion, and inefficient schema design cause application slowdowns, downtime, and poor user experience for applications using Supabase or standard Postgres deployments.

Core Features & Use Cases

  • 8 Prioritized Rule Categories: Covers critical performance areas (query optimization, connection management, row-level security) to incremental improvements (advanced features like full-text search and JSONB indexing), each with quantified performance impact metrics.
  • Actionable SQL Examples: Every rule includes incorrect vs. correct SQL patterns, EXPLAIN output analysis, and Supabase-specific notes for immediate implementation.
  • Use Case: A developer troubleshooting a slow order lookup query can use the query performance rules to add a composite index, reducing query time from 450ms to under 5ms.

Quick Start

Use the supabase-postgres-best-practices skill to review your database's slowest queries from pg_stat_statements and implement the recommended index optimizations.

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?

Optimize slow Postgres queries in Supabase by applying actionable rules for query tuning and schema design. This skill provides incorrect vs. correct SQL patterns and EXPLAIN output analysis to add composite indexes, reducing query latency from 450ms to under 5ms.

What is the best way to fix Postgres connection exhaustion in Supabase?

The best way to fix Postgres connection exhaustion in Supabase is implementing connection management best practices. This skill provides prioritized rules with performance impact metrics to resolve connection pooling issues and meet application scalability and reliability requirements.

How do I analyze pg_stat_statements to improve database performance?

Analyze pg_stat_statements to improve database performance by identifying your slowest queries and implementing recommended index optimizations. This skill applies prioritized rules with SQL examples to resolve performance degradation caused by missing indexes and inefficient queries.

Can I use these Postgres schema design rules for standard Postgres deployments?

Yes, you can use these Postgres schema design rules for standard Postgres deployments. The skill applies actionable rules with SQL examples to optimize schemas and database configurations for both Supabase and standard Postgres deployments.

How do I index JSONB columns for full-text search in Postgres?

Index JSONB columns for full-text search in Postgres by applying advanced feature rules. This skill provides prioritized guidance with SQL examples and performance impact metrics for JSONB indexing and full-text search optimization to meet query latency requirements.

Why does my Supabase Row-Level Security configuration degrade query performance?

Supabase Row-Level Security configurations degrade query performance when poorly optimized. This skill addresses row-level security as a critical performance area, providing actionable rules and SQL examples to meet query latency and scalability requirements without compromising security.