baekenough/oh-my-customcode/postgres-best-practices

Claude Code and agent skill by baekenough/oh-my-customcode

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

PostgreSQL best practices for database design, query optimization, and performance tuning

Install

npx vskill@latest install baekenough/oh-my-customcode/postgres-best-practices

SKILL.md

The same SKILL.md was published earlier as baekenough/oh-my-customcode/postgres-best-practices.

PostgreSQL Best Practices

Query Optimization

EXPLAIN ANALYZE (CRITICAL)
  • Use EXPLAIN ANALYZE to understand query plans
  • Identify slow operations: Seq Scan, Nested Loop
  • Check row estimates vs actual rows
  • Monitor buffers: shared hit vs read
Indexing (CRITICAL)
  • B-tree: default, most use cases
  • GIN: JSONB, arrays, full-text search
  • GiST: geometry, range types
  • BRIN: large sequential tables (time-series)
  • Partial indexes: filtered queries
  • Covering indexes (INCLUDE): avoid heap fetches
Index Maintenance
  • Create indexes concurrently: CREATE INDEX CONCURRENTLY
  • Monitor usage: pg_stat_user_indexes
  • Remove unused indexes
  • Reindex bloated indexes

Table Design

Partitioning (HIGH)
  • Range partitioning: time-series data
  • List partitioning: categorical data
  • Hash partitioning: even distribution
  • Declarative partitioning (PG 10+)
Data Types
  • Use appropriate types (int vs bigint, varchar vs text)
  • JSONB for semi-structured data
  • Arrays for multi-value columns
  • UUIDs for distributed IDs

Performance Tuning

Vacuum and Autovacuum
  • Autovacuum: default enabled
  • Monitor bloat: pg_stat_user_tables
  • Tune autovacuum thresholds
  • Manual VACUUM for large updates
Connection Pooling
  • Use pgBouncer or PgPool
  • Transaction pooling for short transactions
  • Session pooling for long transactions
  • Max connections: tune based on workload
Configuration
  • shared_buffers: 25% of RAM
  • work_mem: per operation, tune carefully
  • effective_cache_size: 50-75% of RAM
  • random_page_cost: 1.1 for SSD

References

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/baekenough/oh-my-customcode/postgres-best-practices/badge)](https://verified-skill.com/skills/baekenough/oh-my-customcode/postgres-best-practices)

Something wrong with this skill or its page? Tell us.