supabase-pg

Improves Supabase performance through query/index/design optimization and RFC 3 compliant fixes.

Updated Apr 16, 2026
One-click install
npx skills add https://github.com/jjmendezrodriguez/jm-claude-plugin --skill supabase-pg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-pg
Source: https://github.com/jjmendezrodriguez/jm-claude-plugin/tree/main/skills/supabase-pg
Command: npx skills add https://github.com/jjmendezrodriguez/jm-claude-plugin --skill supabase-pg

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It fixes slow Supabase Postgres queries by guiding you to optimize at the database layer—especially around missing indexes, inefficient pagination, connection pooling, and Row Level Security (RLS) performance—so your app stays fast under real load.

Core Features & Use Cases

  • Index and query performance optimization: Add the right indexes (including composite and covering/partial indexes), remove N+1 patterns with joins/batching, and design safe pagination strategies.
  • Connection pooling that won’t exhaust your database: Configure Edge Functions to use Supavisor (port 6543) appropriately and avoid pooling-related pitfalls like prepared-statement conflicts.
  • RLS correctness and performance: Write index-friendly RLS policies, avoid subquery patterns that force repeated scans, and ensure RLS is enabled and tested for both authenticated and anon access.

Quick Start

Use this skill when you notice a slow Supabase query or need to add an index, then ask for a rewrite and indexing plan based on your query pattern and table schema.

Frequently Asked Questions about supabase-pg

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix slow Supabase Postgres queries?

Fix slow Supabase Postgres queries by optimizing the database layer. Add composite or partial indexes, rewrite N+1 patterns with joins, and implement safe pagination strategies to improve performance under load.

Why does Row Level Security degrade Postgres query performance?

Row Level Security degrades Postgres query performance when policies use subqueries that force repeated table scans. Write index-friendly RLS policies and ensure proper indexes exist to optimize query plans and concurrency for authenticated and anon access.

What is the correct Supavisor connection pooling endpoint for Supabase Edge Functions?

The correct Supavisor connection pooling endpoint for Supabase Edge Functions is port 6543. Using this endpoint prevents pooling-related pitfalls like prepared-statement conflicts and avoids exhausting your database connections.

How to handle pagination in Postgres without OFFSET?

Handle pagination in Postgres without OFFSET by implementing safe pagination strategies like keyset pagination. Designing index-friendly pagination prevents performance degradation associated with OFFSET-based pagination problems in large Supabase datasets.

When should I add composite or covering indexes in Supabase?

Add composite or covering indexes in Supabase when diagnosing slow queries or designing schemas and migrations. Target specific query patterns to produce index patterns optimized for Postgres query plans and concurrency.