postgres-patterns

Apply indexing, partitioning, and query-pattern techniques for PostgreSQL optimization.

Updated Feb 11, 2026
One-click install
npx skills add https://github.com/shygoly/sapbase --skill postgres-patterns-shygoly
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-patterns
Source: https://github.com/shygoly/sapbase/tree/main/docs/zh-TW/skills/postgres-patterns
Command: npx skills add https://github.com/shygoly/sapbase --skill postgres-patterns-shygoly

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PostgreSQL patterns to help you build fast, reliable databases by following best practices for queries, schemas, indexing, and security based on Supabase guidance.

Core Features & Use Cases

  • Indexing strategies: recommended index types and ordering to speed up common queries.
  • Schema design patterns: table normalization, denormalization tradeoffs, and relation modeling.
  • Security patterns: Row Level Security (RLS) and access control best practices for safe data access.
  • Use Case: Design a new multi-tenant schema with efficient indexing and robust access control.

Quick Start

Describe a slow query scenario you are facing and apply the postgres-patterns guidelines to optimize it.

Frequently Asked Questions about postgres-patterns

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

FAQPage Schema
How do I optimize slow PostgreSQL queries in Supabase?

To optimize slow PostgreSQL queries, apply recommended index types and ordering strategies aligned with Supabase best practices to speed up common query patterns and improve database performance.

What are the best schema design patterns for multi-tenant PostgreSQL databases?

Effective schema design for multi-tenant PostgreSQL databases involves applying table normalization, evaluating denormalization tradeoffs, and modeling relations to ensure scalable and reliable database architectures.

How does Row Level Security (RLS) work for PostgreSQL access control?

Row Level Security (RLS) provides access control by enforcing security patterns that ensure safe data access in production databases, allowing you to restrict row-level data visibility based on user roles.

When should I use partitioning for PostgreSQL performance tuning?

You should use partitioning for PostgreSQL performance tuning when managing large datasets, as it aligns with query-pattern techniques to distribute data efficiently and maintain fast, reliable database operations.

Do I need specific database patterns for Supabase migrations?

Applying PostgreSQL patterns for Supabase migrations is necessary to maintain performance and security, ensuring that schema changes, indexing, and RLS policies follow production-grade best practices.