supabase-postgres-best-practices

Provide guidelines for optimizing Postgres performance in Supabase databases.

Updated Dec 13, 2025
One-click install
npx skills add https://github.com/fmbp1981-hash/cavendish-gig --skill supabase-postgres-best-practices-fmbp1981-hash
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-postgres-best-practices
Source: https://github.com/fmbp1981-hash/cavendish-gig/tree/main/.gemini/skills/supabase-postgres-best-practices
Command: npx skills add https://github.com/fmbp1981-hash/cavendish-gig --skill supabase-postgres-best-practices-fmbp1981-hash

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidelines for optimizing Postgres performance, addressing query performance, connection management, security, schema design, concurrency, data access patterns, monitoring, and advanced features.

Core Features & Use Cases

  • Query Performance Optimization: Rules for indexing, query planning, and partial indexing.
  • Connection Management: Strategies for connection pooling, idle timeouts, and connection limits.
  • Security & RLS: Best practices for row-level security, least privilege, and authentication patterns.
  • Schema Design: Guidelines for choosing data types, indexing foreign keys, partitioning, and primary key strategies.
  • Concurrency & Locking: Techniques for transaction management, deadlock prevention, and lock contention patterns.
  • Use Case: If you are working with Supabase and need to optimize your database performance, this Skill provides actionable advice to improve query speed, ensure data security, and maintain system stability.

Quick Start

Use the supabase-postgres-best-practices skill to review the best practices for optimizing Postgres performance and apply them to your database.

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

To optimize Postgres query performance in Supabase, apply indexing rules, query planning strategies, and partial indexing guidelines to improve execution speed and reduce latency.

What are the best practices for Supabase row-level security and authentication?

Supabase row-level security best practices involve implementing least privilege access, defining strict RLS policies, and applying secure authentication patterns to protect data at the table level.

How should I manage database connections and pooling in Postgres?

Manage Postgres connections by applying connection pooling, configuring idle timeouts, and enforcing connection limits to prevent resource exhaustion during high concurrency.

What is the best way to design a Postgres schema for high concurrency?

Designing a Postgres schema for high concurrency requires choosing optimal data types, indexing foreign keys, partitioning large tables, and applying primary key strategies to minimize lock contention.

Does this Postgres optimization guidance apply to databases outside of Supabase?

Yes, these Postgres optimization guidelines apply to Supabase and any Postgres-based database systems, covering schema design, concurrency, and advanced features for general performance improvement.