supabase-postgres-best-practices

Solid

Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.

API & Backend 60 stars 19 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 87/100

Stars 20%
59
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Supabase Postgres Best Practices Comprehensive performance optimization guide for Postgres, maintained by Supabase. Contains rules across 8 categories, prioritized by impact to guide automated query optimization and schema design. ## When to Apply Reference these guidelines when: - Writing SQL queries or designing schemas - Implementing indexes or query optimization - Reviewing database performance issues - Configuring connection pooling or scaling - Optimizing for Postgres-specific features - Working with Row-Level Security (RLS) ## Quick Decision Tree ``` Problem? ├─ Slow query → query-missing-indexes, query-composite-indexes, monitor-explain-analyze ├─ Connection errors / timeouts → conn-pooling, conn-limits, conn-idle-timeout ├─ Deadlocks / long transactions → lock-short-transactions, lock-deadlock-prevention ├─ Bulk load slow → data-batch-inserts, data-upsert ├─ Table bloat / VACUUM issues → monitor-vacuum-analyze ├─ JSONB queries slow → advanced-jsonb-indexing ├─ FTS / search quality → advanced-full-text-search (pair with /postgres-semantic-search for BM25 + vector) └─ Security / multi-tenant → security-* rules, RLS ``` ## Related Skills - `/postgres-semantic-search` — Vector search (pgvector), hybrid BM25 + semantic, ParadeDB - `/nextjs-chatbot` — Chatbot orchestration, session DB, feedback, HITL - `/ai-sdk` — AI SDK patterns for backend integration ## Rule Categories by Priority | Priority | Category | Impact | Prefix | |----------|----------|--------|-----...

Details

Author
laguagu
Repository
laguagu/claude-code-nextjs-skills
Created
7 months ago
Last Updated
yesterday
Language
TypeScript
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

API & Backend Listed

supabase-postgres-best-practices

Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pg_cron, pgmq), vector/semantic search (pgvector), and restoring dumps (pg_restore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.

0 Updated 1 weeks ago
sanketbodke
API & Backend Listed

supabase-postgres-best-practices

Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pg_cron, pgmq), vector/semantic search (pgvector), and restoring dumps (pg_restore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.

6 Updated today
SunrisesIllNeverSee
API & Backend Solid

supabase-postgres-best-practices

Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pg_cron, pgmq), vector/semantic search (pgvector), and restoring dumps (pg_restore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.

45 Updated today
YuDefine