Skip to content
SkillImported

postgres-best-practices

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

Imported description, not reviewed yet

This item came from its original repository and was only scanned automatically; no editor has written an Arabic description for it yet. Read its content yourself before you rely on it. This page is not indexed by search engines until it is reviewed.

Download

Files: 37 · Size: 100 KB

Download the ZIP

The file carries the license of the original source.

Install

After downloading, run the command in a terminal. unzip asks before it replaces any file that is there.

  • For this project

    It goes in: .claude/skills/postgres-best-practices/

    mkdir -p .claude/skills && unzip ~/Downloads/postgres-best-practices.zip -d .claude/skills

  • For your account on the whole machine

    It goes in: ~/.claude/skills/postgres-best-practices/

    mkdir -p ~/.claude/skills && unzip ~/Downloads/postgres-best-practices.zip -d ~/.claude/skills

Instructions

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)

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Query PerformanceCRITICALquery-
2Connection ManagementCRITICALconn-
3Security & RLSCRITICALsecurity-
4Schema DesignHIGHschema-
5Concurrency & LockingMEDIUM-HIGHlock-
6Data Access PatternsMEDIUMdata-
7Monitoring & DiagnosticsLOW-MEDIUMmonitor-
8Advanced FeaturesLOWadvanced-

How to Use

Read individual rule files for detailed explanations and SQL examples:

rules/query-missing-indexes.md
rules/schema-partial-indexes.md
rules/_sections.md

Each rule file contains:

  • Brief explanation of why it matters
  • Incorrect SQL example with explanation
  • Correct SQL example with explanation
  • Optional EXPLAIN output or metrics
  • Additional context and references
  • Supabase-specific notes (when applicable)

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

Files

  • folderrules49 KB
    • _contributing.md4 KB
    • _sections.md1.6 KB
    • _template.md1 KB
    • advanced-full-text-search.md1.4 KB
    • advanced-jsonb-indexing.md1.4 KB
    • conn-idle-timeout.md1.3 KB
    • conn-limits.md1.3 KB
    • conn-pooling.md1.3 KB
    • conn-prepared-statements.md1.5 KB
    • data-batch-inserts.md1.3 KB
    • data-n-plus-one.md1.3 KB
    • data-pagination.md1.3 KB
    • data-upsert.md1.4 KB
    • lock-advisory.md1.5 KB
    • lock-deadlock-prevention.md1.8 KB
    • lock-short-transactions.md1.3 KB
    • lock-skip-locked.md1.3 KB
    • monitor-explain-analyze.md1.4 KB
    • monitor-pg-stat-statements.md1.4 KB
    • monitor-vacuum-analyze.md1.5 KB
    • query-composite-indexes.md1.4 KB
    • query-covering-indexes.md1.3 KB
    • query-index-types.md1.4 KB
    • query-missing-indexes.md1.2 KB
    • query-partial-indexes.md1.3 KB
    • schema-data-types.md1.4 KB
    • schema-foreign-key-indexes.md1.6 KB
    • schema-lowercase-identifiers.md1.7 KB
    • schema-partitioning.md1.5 KB
    • schema-primary-keys.md1.8 KB
    • security-privileges.md1.5 KB
    • security-rls-basics.md1.3 KB
    • security-rls-performance.md1.5 KB
  • AGENTS.md44 KB
  • LICENSE1 KB
  • README.md3.1 KB
  • SKILL.md1.8 KB
  • metadata.json818 B

Comments (0)

No comments yet. Be the first.

Sign in to comment. Commenting comes at level 1 (Member).

Report

Similar items

  • SkillImported

    alloydb-basics

    Manages clusters, instances, and backups for AlloyDB for PostgreSQL, and integrates with AlloyDB MCP tools for automated database operations including AI-powered search and vector capabilities.

    MITFiles: 7

  • SkillImported

    alphafold-database

    Access AlphaFold's 200M+ AI-predicted protein structures. Retrieve structures by UniProt ID, download PDB/mmCIF files, analyze confidence metrics (pLDDT, PAE), for drug discovery and structural biology.

    MITFiles: 2

  • SkillImportedContains scripts

    biorxiv-database

    Efficient database search tool for bioRxiv preprint server. Use this skill when searching for life sciences preprints by keywords, authors, date ranges, or categories, retrieving paper metadata, downloading PDFs, or conducting literature re

    MITFiles: 3

  • SkillImportedContains scripts

    brenda-database

    Access BRENDA enzyme database via SOAP API. Retrieve kinetic parameters (Km, kcat), reaction equations, organism data, and substrate-specific enzyme information for biochemical research and metabolic pathway analysis.

    MITFiles: 5

  • SkillImported

    bullmq-specialist

    BullMQ expert for Redis-backed job queues, background processing, and reliable async execution in Node.js/TypeScript applications. Use when: bullmq, bull queue, redis queue, background job, job queue.

    MITFiles: 1

  • SkillImported

    cc-skill-clickhouse-io

    ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.

    MITFiles: 1