postgres-patterns

Reference PostgreSQL optimization, schema design, indexing, and security best practices.

19|4|Updated Mar 1, 2026
One-click install
npx skills add https://github.com/j7-dev/everything-github-copilot --skill postgres-patterns-j7-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-patterns
Source: https://github.com/j7-dev/everything-github-copilot/tree/main/docs/ja-JP/skills/postgres-patterns
Command: npx skills add https://github.com/j7-dev/everything-github-copilot --skill postgres-patterns-j7-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a quick reference for optimizing PostgreSQL database performance, covering indexing, data types, common patterns, and anti-patterns.

Core Features & Use Cases

  • Index Cheat Sheet: Quickly find the right index type for common query patterns.
  • Data Type Guidance: Choose appropriate data types for efficiency and correctness.
  • Pattern Examples: Demonstrates best practices for composite indexes, covering indexes, RLS, UPSERT, and more.
  • Anti-Pattern Detection: Includes SQL queries to identify common performance pitfalls.

Quick Start

Use the postgres-patterns skill to find the correct index type for a WHERE clause filtering on a JSONB column.

Frequently Asked Questions about postgres-patterns

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

FAQPage Schema
How do I choose the right PostgreSQL index for a WHERE clause filtering on a JSONB column?

To optimize PostgreSQL queries on a JSONB column, use a GIN index. This index type accelerates containment queries and key lookups within JSON documents, significantly improving filter performance.

What are common PostgreSQL anti-patterns for schema design and performance tuning?

Common PostgreSQL anti-patterns include incorrect data type selection and inefficient indexing strategies. You can detect these performance pitfalls using specific SQL queries to analyze your database schema and identify bottlenecks.

Can I use this PostgreSQL optimization reference for Supabase database operations?

Yes, the PostgreSQL optimization patterns are based on Supabase best practices. They provide efficient database operations guidance covering indexing, Row Level Security, and UPSERT implementations suitable for Supabase environments.

What's the best way to implement composite indexes and covering indexes in PostgreSQL?

The best way to implement composite and covering indexes is by matching column order to your query predicates. This reference demonstrates best practices for structuring these indexes to optimize complex PostgreSQL query performance.

Why does selecting the wrong data type cause performance issues in PostgreSQL?

Selecting the wrong data type causes performance issues by increasing storage requirements and slowing down query execution. Choosing appropriate data types ensures efficiency, correctness, and optimal index usage in PostgreSQL.