postgresql-optimization

postgresql-optimization is a skill for Claude Code, Codex from tmolavi/mcp-agent-skills-hub. It costs 26 tokens per session (955 once invoked), scanned A, original, MIT.

A workflow for improving PostgreSQL databases, the open-source database system, by tuning queries, choosing indexes, checking performance, and managing production settings.

In plain words
What is it for?
Use it to inspect slow queries, run PostgreSQL performance checks, design indexes, tune configuration, manage vacuum tasks, and investigate production bottlenecks.
Why use it?
It gives a structured way to find why database work is slow or unhealthy and decide what to change. It helps avoid guessing when tuning a live database.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to inspect slow queries, run PostgreSQL performance checks, design indexes, tune configuration, manage vacuum tasks, and investigate production bottlenecks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tmolavi/mcp-agent-skills-hub/postgresql-optimization
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add tmolavi/mcp-agent-skills-hub --skill postgresql-optimization
Clone the repo
git clone --depth 1 https://github.com/tmolavi/mcp-agent-skills-hub

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for postgresql-optimization

README.md
[![agentmods](https://agentmods.dev/badge/skills/tmolavi/mcp-agent-skills-hub/postgresql-optimization.svg)](https://agentmods.dev/skills/tmolavi/mcp-agent-skills-hub/postgresql-optimization)
Your own site
<a href="https://agentmods.dev/skills/tmolavi/mcp-agent-skills-hub/postgresql-optimization"><img src="https://agentmods.dev/badge/skills/tmolavi/mcp-agent-skills-hub/postgresql-optimization.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 955 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00026 $0.00955
Opus 5 $0.00013 $0.00477
Sonnet 5 $0.00005 $0.00191
Haiku 4.5 $0.00003 $0.00096

Measured 4d ago against content hash 7e38bae10d0d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

postgresql-optimization scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/postgresql-optimization/SKILL.md · 180 lines

How it starts

The opening of the file, as written. The whole thing — 180 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PostgreSQL Optimization Workflow

Overview

Specialized workflow for PostgreSQL database optimization including query tuning, indexing strategies, performance analysis, vacuum management, and production database administration.

When to Use This Workflow

Use this workflow when:

  • Optimizing slow PostgreSQL queries
  • Designing indexing strategies
  • Analyzing database performance
  • Tuning PostgreSQL configuration
  • Managing production databases

Workflow Phases

Phase 1: Performance Assessment

Skills to Invoke
  • database-optimizer - Database optimization
  • postgres-best-practices - PostgreSQL best practices
Actions
  1. Check database version
  2. Review configuration
  3. Analyze slow queries
  4. Check resource usage
  5. Identify bottlenecks
Copy-Paste Prompts
Use @database-optimizer to assess PostgreSQL performance

Phase 2: Query Analysis

Skills to Invoke
  • sql-optimization-patterns - SQL optimization
  • postgres-best-practices - PostgreSQL patterns
Actions
  1. Run EXPLAIN ANALYZE
  2. Identify scan types
  3. Check join strategies
  4. Analyze execution time
  5. Find optimization opportunities
Copy-Paste Prompts
Use @sql-optimization-patterns to analyze and optimize queries

Phase 3: Indexing Strategy

Skills to Invoke
  • database-design - Index design
  • postgresql - PostgreSQL indexing
Actions
  1. Identify missing indexes
  2. Create B-tree indexes
  3. Add composite indexes
  4. Consider partial indexes
  5. Review index usage
Copy-Paste Prompts
Use @database-design to design PostgreSQL indexing strategy

Phase 4: Query Optimization

Skills to Invoke
  • sql-optimization-patterns - Query tuning
  • sql-pro - SQL expertise
Actions
  1. Rewrite inefficient queries
  2. Optimize joins
  3. Add CTEs where helpful
  4. Implement pagination
  5. Test improvements
Copy-Paste Prompts
Use @sql-optimization-patterns to optimize SQL queries

Phase 5: Configuration Tuning

Read the full file on GitHub · 180 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 180 lines · 26 tokens per session scan A 7e38bae10d0d

Subscribe to this mod's changes

postgresql-optimization is a skill published in the GitHub repository tmolavi/mcp-agent-skills-hub (8 stars, last pushed 11d ago), licensed MIT. It adds 26 tokens to every session and 955 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

sql-queries

Write correct, performant SQL across all major data warehouse dialects (Snowflake, BigQuery, Databricks, PostgreSQL, etc.). Use when writing queries, optimizing slow SQL, translating between dialects, or building complex analytical queries with CTEs, window functions, or aggregations.

w95/awesome-claude-corporate-skills · 63 tokens

postgres

Execute read-only SQL queries against multiple PostgreSQL databases. Use when: (1) querying PostgreSQL databases, (2) exploring database schemas/tables, (3) running SELECT queries for data analysis, (4) checking database contents. Supports multiple database connections with descriptions for intelligent auto-selection.…

w95/awesome-claude-corporate-skills · 79 tokens

database-patterns

DB schema design and query tuning: normalization, indexing, N+1, transactions, EXPLAIN. Triggers: schema, index, slow query, N+1, PostgreSQL, MySQL, EXPLAIN, deadlock, query plan.

softspark/ai-toolkit · 55 tokens

database-migrations-sql-migrations

SQL database migrations with zero-downtime strategies for PostgreSQL, MySQL, SQL Server.

rmyndharis/antigravity-skills · 26 tokens

edge-serverless-db-expert

Expert guide for Serverless & Edge Databases (Neon Serverless Postgres, Cloudflare D1, Turso/libsql, Upstash Redis), cold-start mitigation, and connection pooling / Panduan ahli database Serverless & Edge (Neon, Cloudflare D1, Turso, Upstash).

roedyrustam/vibes-plug · 69 tokens

api-database-postgresql

Direct PostgreSQL access with node-postgres (pg) -- connection pools, parameterized queries, transactions, streaming, LISTEN/NOTIFY, error handling.

agents-inc/skills · 37 tokens