Skip to content
Back to skills

Postgres Performance

ASecurity

Tune PostgreSQL throughput and stability via pooling, vacuum tuning, partitioning, and pg_stat_statements

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
ai-agentssqldatabaseperformance

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill postgres-performance --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Postgres Performance?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Postgres Performance
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-postgres-performance/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-postgres-performance)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Tune PostgreSQL throughput and stability via pooling, vacuum tuning, partitioning, and pg_stat_statements
profile: standard
tags: database, postgres, performance, operations
---

# Postgres performance

Use when diagnosing PostgreSQL CPU/I/O bottlenecks, connection saturation, table bloat, or scaling growth.

## Connections and memory
- Place PgBouncer in `transaction` pooling mode in front of serverless or high-concurrency apps; keep `max_connections` conservative and reserve superuser slots.
- Avoid setting `work_mem` high globally (`max_connections * work_mem * active sorts` can OOM); raise it per-session or per-query when needed.
- Inspect `pg_stat_statements` sorted by `total_exec_time` and `shared_blks_read` before touching server flags.

## Maintenance and scaling
- Watch dead tuple ratios (`n_dead_tup`) on hot update/delete tables; lower per-table `autovacuum_vacuum_scale_factor` (e.g., `0.02`) instead of relying solely on default 20% thresholds on multi-million-row tables.
- Partition high-volume append tables (events, logs, telemetry) by time so retention drops partitions cleanly instead of creating vacuum storms.
- Tune `random_page_cost` for SSD storage (`~1.1`) so the planner prefers index scans appropriately.

## Verify
Check `pg_stat_statements`, `pg_stat_user_tables` bloat/vacuum lag, and `EXPLAIN (ANALYZE, BUFFERS)` before and after tuning.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.