supabase-postgres-best-practices

Optimize Supabase and PostgreSQL queries with prioritized SQL fixes and configuration changes.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/kyamsSRL/TinyCopro --skill supabase-postgres-best-practices-kyamssrl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-postgres-best-practices
Source: https://github.com/kyamsSRL/TinyCopro/tree/main/.agents/skills/supabase-postgres-best-practices
Command: npx skills add https://github.com/kyamsSRL/TinyCopro --skill supabase-postgres-best-practices-kyamssrl

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill codifies Supabase and Postgres performance best practices to help teams find and fix slow queries, misconfigured connections, security gaps, and suboptimal schemas. It reduces diagnostic time by translating common anti-patterns into prioritized, actionable SQL fixes and configuration changes for real-world deployments.

Core Features & Use Cases

  • Prioritized Rule Set: Eight categories ranked by impact (query performance, connections, RLS, schema, locking, data access, monitoring, advanced features) to focus remediation where it matters most.
  • Concrete Transformations: Each reference shows an incorrect pattern and a corrected SQL solution with explanation and expected impact, enabling automated or manual application of fixes.
  • Operational Guidance: Includes EXPLAIN analysis tips, connection pooling and timeout settings, RLS performance patterns, indexing strategies, partitioning, and migration-safe constraint patterns.
  • Agent & CI Integration: Designed for AI agents and build tooling with validation and build scripts in the broader project, enabling generation of AGENTS.md and automated checks.

Quick Start

Analyze this slow query and return prioritized fixes with concrete SQL examples, index recommendations, and any connection or RLS configuration changes.

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?

You can optimize slow Postgres queries by analyzing EXPLAIN output and applying prioritized, rule-based fixes including targeted index creation and SQL rewrites to eliminate inefficient database configurations.

What is the best way to configure Supabase connection pooling and timeouts?

The best way to configure Supabase connection pooling is to apply operational timeout settings and pooling rules that prevent connection exhaustion and ensure scalable PostgreSQL request handling.

How does Row Level Security affect Postgres query performance?

Row Level Security (RLS) affects Postgres query performance by adding policy checks to data access paths, requiring specific RLS optimization patterns to prevent security configurations from causing slow queries.

Can I use automated agents to fix PostgreSQL schema migrations?

Yes, you can use automated agents to fix PostgreSQL schema migrations by leveraging provided migration-safe constraint patterns and corrected SQL examples designed specifically for AI agent and CI integration.

When should I use table partitioning for Supabase Postgres scalability?

You should use table partitioning for Supabase Postgres scalability when advanced features are needed to manage large datasets, applying schema migrations and locking rules to maintain query performance.