Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

postgresql-optimization

Skill by sickn33

Guides PostgreSQL query tuning, indexing, configuration and maintenance through a seven-phase workflow. Built for database administrators and developers who manage slow or production PostgreSQL databases.

  • Score 89
  • 50k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install postgresql-optimization

Built from the published package, never by AI.

git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.claude/skills && cp -r /tmp/agentic-awesome-skills/skills/postgresql-optimization ~/.claude/skills/postgresql-optimization

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install postgresql-optimization in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill is a seven-phase workflow for optimizing PostgreSQL databases. It covers performance assessment, query analysis with EXPLAIN, indexing strategy, query rewriting, configuration tuning such as shared_buffers and work_mem, routine maintenance with VACUUM and ANALYZE, and monitoring. Each phase names other skills to invoke and gives copy-paste prompts.

The workflow stresses careful change control. It asks users to record baseline latency, rows, plan and workload, and to change one variable at a time. It advises agreeing on a maintenance window and rollback before changes that can take locks or require a restart, and validating result equivalence as well as latency. It is aimed at people who manage slow or production PostgreSQL databases.

Written from the project's SKILL.md and checked against it.

What it can do

  • Performance assessmentChecks database version, configuration, slow queries, resource usage and bottlenecks.
  • Query analysisUses EXPLAIN to identify scan types, join strategies and execution time.
  • Indexing strategyIdentifies missing indexes and covers B-tree, composite and partial indexes.
  • Query optimizationRewrites inefficient queries, optimizes joins, adds CTEs and implements pagination.
  • Configuration tuningCovers shared_buffers, work_mem, effective_cache_size, checkpoints and autovacuum.
  • MaintenanceCovers scheduling VACUUM, running ANALYZE, checking table bloat and reviewing statistics.
  • MonitoringCovers setting up monitoring, dashboards, alerts and tracking of key metrics.

What you need

  • A PostgreSQL database

Try asking

  • Use @sql-optimization-patterns to analyze and optimize queries
  • Use @database-design to design PostgreSQL indexing strategy
  • Use @postgres-best-practices to tune PostgreSQL configuration

Good to know

  • EXPLAIN ANALYZE executes the statement, so use a staging copy for writes or expensive queries.
  • Index creation and configuration changes can consume disk, take locks or require restart.
  • VACUUM FULL rewrites and locks tables.
  • The output is not a substitute for environment-specific validation, testing or expert review.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/postgresql-optimization/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md5 KB

Alternatives to postgresql-optimization

All alternatives →
hugging-face-datasetssickn33
94

Creates, configures and manages datasets on the Hugging Face Hub, including SQL-based querying and transformation. Built for people who edit dataset content and metadata directly, alongside the HF MCP server.

AAA Skill 50k
db-repairgarrytan
94

Diagnoses and repairs gbrain's Postgres access when a command or MCP result shows a GBRAIN_DB_ACCESS marker, or when the operator reports the brain database is down. It runs the hardcoded gbrain db-repair ladder and verifies the result with a re-probe.

AAA Skill 34k
alloydb-basicsgoogle
94

Manages clusters, instances, and backups for AlloyDB for PostgreSQL. Built for creating, configuring, and administering AlloyDB databases, not general PostgreSQL or Cloud SQL instances.

AAA Skill 26k
clickhouse-logs-queriessupabase
94

Writes, reviews and migrates Supabase logs queries against the ClickHouse logs table served by the logs.all.otel endpoint. Built for developers who write Logs Explorer SQL or convert older BigQuery logs queries.

AAA Skill 116k
fix-slow-queriespaperclipai
94

Diagnoses and fixes slow Paperclip PostgreSQL queries using Cloud and Neon evidence, local benchmarks, regression tests, and a pull request with passing checks. Built for engineers working on Paperclip.

AAA Skill 119k
prisma-8prisma
94

Guides AI assistants through Prisma 8 projects built on @prisma/orm-postgres, @prisma/orm-sqlite, or @prisma/orm-mongo. It covers data contracts, migrations, typed queries and runtime setup for developers on Prisma 8.

AAA Skill 48k

Compare with hugging-face-datasets, db-repair or alloydb-basics

postgresql-optimization: common questions

Does running this workflow change my database?

The source says EXPLAIN ANALYZE executes the statement, so use a representative staging copy for writes or expensive queries. Index creation and configuration changes can take locks or require restart, so agree on a maintenance window and rollback first.

Which skills does this workflow call?

It names database-optimizer, postgres-best-practices, sql-optimization-patterns, database-design, postgresql, sql-pro, database-admin, grafana-dashboards and prometheus-configuration. Phase 7 uses grafana-dashboards and prometheus-configuration for monitoring.

Should I run VACUUM FULL to clean up bloat?

The source advises preferring routine autovacuum monitoring over indiscriminate manual maintenance. It also warns that VACUUM FULL rewrites and locks tables.

How do I install postgresql-optimization?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is postgresql-optimization free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is postgresql-optimization safe to use?

It scores 89 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to postgresql-optimization?

Similar skills: hugging-face-datasets, db-repair, alloydb-basics, clickhouse-logs-queries.

postgresql-optimization Install

Add to stack

Loading.