# postgresql-database-engineering

Guides database design, index selection, and query optimization in PostgreSQL. Useful when tuning slow queries, setting up table partitioning, or configuring replication.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1800 installs · ★ 62
- Author: manutej
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/manutej/luxor-claude-marketplace/tree/HEAD/plugins/luxor-database-pro/skills/postgresql-database-engineering/SKILL.md
- Updated: 2026-06-13
- HTML: https://affpapa.org/en/nevibecode/skills/postgresql-database-engineering

## What it does

The skill supplies your coding agent with engineering guidelines for PostgreSQL. It covers transaction isolation levels, connection pooling with pgBouncer or PgPool, and query plan diagnosis via `EXPLAIN ANALYZE`. The material details engine internals, including shared memory, write-ahead logs, and multi-version concurrency control mechanics where VACUUM reclaims dead tuple storage.

Index guidance spans six access methods, from standard B-Tree to BRIN for append-only datasets. GiST handles geometric types, while GIN covers array and JSONB searches. Index selection requires tradeoffs. GIN indexes slow down writes, while hash indexes support only strict equality.

For massive datasets with 100M+ rows, the skill outlines declarative range, list, and hash partitioning. This setup enables partition pruning, letting the planner discard irrelevant tables before reading disk blocks.

## Requirements
- Works with: PostgreSQL

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add manutej/luxor-claude-marketplace --skill postgresql-database-engineering -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/postgresql-database-engineering/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/postgresql-database-engineering/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add manutej/luxor-claude-marketplace --skill postgresql-database-engineering -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/postgresql-database-engineering/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add manutej/luxor-claude-marketplace --skill postgresql-database-engineering -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/postgresql-database-engineering/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install manutej/luxor-claude-marketplace postgresql-database-engineering
```

2. **Manually: put the files in place**
- File: `.github/skills/postgresql-database-engineering/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add manutej/luxor-claude-marketplace --skill postgresql-database-engineering -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/manutej/luxor-claude-marketplace --path plugins/luxor-database-pro/skills/postgresql-database-engineering
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/postgresql-database-engineering/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add manutej/luxor-claude-marketplace --skill postgresql-database-engineering -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/manutej/luxor-claude-marketplace/tree/HEAD/plugins/luxor-database-pro/skills/postgresql-database-engineering/SKILL.md

## When to use it
- choose appropriate index types for JSONB, arrays, and geometric data
- optimize slow queries using EXPLAIN ANALYZE execution plans
- partition large tables exceeding 100M rows by range, list, or hash
- configure connection pooling with pgBouncer or PgPool
- tune autovacuum to reclaim space from dead tuples under MVCC

## Example prompts
- Analyze this EXPLAIN ANALYZE output and suggest whether to use a B-Tree or BRIN index
- Help me set up monthly range partitioning for an events table with over 100M rows
- Review our VACUUM and transaction isolation settings to handle frequent updates without table bloat

## Similar
- [postgresql-best-practices](https://affpapa.org/en/nevibecode/skills/postgresql-best-practices.md) — skill · 1500 installs
- [database-optimizer](https://affpapa.org/en/nevibecode/skills/httpsgithubcomjeffallan-database-optimizer.md) — skill · 6000 installs
- [PostgreSQL Database Administrator](https://affpapa.org/en/nevibecode/agents/postgresql-database-administrator.md) — subagent · ★ 40418
- [postgresql-expert](https://affpapa.org/en/nevibecode/skills/postgresql-expert.md) — skill · 424 installs
- [database-design](https://affpapa.org/en/nevibecode/skills/moizibnyousaf-database-design.md) — skill · 604 installs
- [database-indexing-strategy](https://affpapa.org/en/nevibecode/skills/database-indexing-strategy.md) — skill · 486 installs

From the same set: [manutej/luxor-claude-marketplace](https://affpapa.org/en/nevibecode/by/manutej/luxor-claude-marketplace.md) — 31 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
