Agent skill · data analytics · affaan-m

postgres-patterns

PostgreSQL database patterns for query optimization, schema design, indexing, and security. Based on Supabase best practices.

Why this skill is useful

Provides domain-specific knowledge on PostgreSQL query optimization, indexing strategies, and security practices that the AI wouldn't reliably generate on its own.

What it needs

About 2k tokens when loaded. Last updated 2026-08-06. 238,342 stars on the source repository.

What this skill does

PostgreSQL 模式 PostgreSQL 最佳實務快速參考。詳細指南請使用 database-reviewer agent。 何時啟用 撰寫 SQL 查詢或 migrations 設計資料庫 schema 疑難排解慢查詢 實作 Row Level Security 設定連線池 快速參考 索引速查表 查詢模式 索引類型 範例 --------- --------- ------ WHERE col = value B-tree(預設) CREATE INDEX idx ON t (col) WHERE col > value B-tree CREATE INDEX idx ON t (col) WHERE a = x AND b > y 複合 CREATE INDEX idx ON t (a, b) WHERE jsonb @> '{}' GIN CREATE INDEX idx ON t USING gin (col) WHERE tsv @@ query GIN CREATE INDEX idx ON t USING gin (col) 時間序列範圍 BRIN CREATE INDEX idx ON t USING brin (col) 資料類型快速參考 使用情況 正確類型 避免 --------- --------- ------ IDs bigint int、隨機 UUID 字串 text varchar(255) 時間戳 timestamptz timestamp 金額 numeric(10,2) float 旗標 boolean varchar、int 常見模式 複合索引順序: 覆蓋索引: 部分索引: RLS 政策(優化): UPSERT: 游標分頁: 佇列處理: 反模式偵測 設定範本 相關 Agent:database-reviewer - 完整資料庫審查工作流程 Skill:clickhouse-io - ClickHouse 分析模式 Skill:backend-patterns - API 和後端模式 --- 基於 Supabase Agent Skills)(MIT 授權)

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills affaan-m/postgres-patterns--27c80d

View the source on GitHub

Browse the @skills marketplace