pg-io-deep-dive

pg-io-deep-dive is a skill for Claude Code, Codex from isdaniel/pgtuner_mcp. It costs 67 tokens per session (2,610 once invoked), scanned A, original, Apache-2.0.

A guide for investigating PostgreSQL database input and output (I/O), meaning how data moves between memory, storage, tables, indexes, and temporary files.

In plain words
What is it for?
It supports analysis of buffer pools, table and index activity, temporary files, checkpoints, wait events, cache ratios, configuration, and their relationship to query performance.
Why use it?
It helps explain slow queries, cache misses, excessive disk activity, temporary-file spills, and frequent checkpoints.

Skill for Claude CodeCodex

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

Good fit It supports analysis of buffer pools, table and index activity, temporary files, checkpoints, wait events, cache ratios, configuration, and their relationship to query performance.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/isdaniel/pgtuner_mcp/pg-io-deep-dive
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 isdaniel/pgtuner_mcp --skill pg-io-deep-dive
Clone the repo
git clone --depth 1 https://github.com/isdaniel/pgtuner_mcp

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 pg-io-deep-dive

README.md
[![agentmods](https://agentmods.dev/badge/skills/isdaniel/pgtuner_mcp/pg-io-deep-dive/github.svg)](https://agentmods.dev/skills/isdaniel/pgtuner_mcp/pg-io-deep-dive)
Your own site
<a href="https://agentmods.dev/skills/isdaniel/pgtuner_mcp/pg-io-deep-dive"><img src="https://agentmods.dev/badge/skills/isdaniel/pgtuner_mcp/pg-io-deep-dive/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pg-io-deep-dive

Your own site · 80×15
<a href="https://agentmods.dev/skills/isdaniel/pgtuner_mcp/pg-io-deep-dive"><img src="https://agentmods.dev/badge/skills/isdaniel/pgtuner_mcp/pg-io-deep-dive.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,610 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.00067 $0.02610
Opus 5 $0.00034 $0.01305
Sonnet 5 $0.00013 $0.00522
Haiku 4.5 $0.00007 $0.00261

Measured 8d ago against content hash a902ecf51063, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

pg-io-deep-dive 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 8d 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/pg-io-deep-dive/SKILL.md · 311 lines

How it starts

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

PostgreSQL I/O Deep-Dive

This skill guides a thorough investigation of PostgreSQL I/O performance using the full capabilities of the analyze_disk_io_patterns tool, correlating I/O data with query workload and configuration.

When to Use This Skill

Use this skill when the user:

  • Reports high disk I/O or slow disk performance
  • Sees queries with high blks_read or low cache hit ratios
  • Reports temp_blks_written in slow queries (work_mem too low)
  • Sees frequent checkpoint warnings in PostgreSQL logs
  • Has "IO" wait events from analyze_wait_events
  • Asks "why is my database doing so much disk I/O?"
  • Is sizing storage or evaluating SSD vs HDD performance

MCP Resources Available

  • pgtuner://health/cache -- Quick cache hit ratio check (lightweight, no full health scan)
  • pgtuner://settings/memory -- Current memory configuration
  • pgtuner://settings/checkpoint -- Current checkpoint configuration
  • pgtuner://table/{schema}/{table_name}/stats -- Table-level I/O statistics

This skill extends the I/O analysis portions of the health_check and diagnose_slow_queries MCP Prompts.

Prerequisites

  • The pgtuner-mcp server must be connected with a valid DATABASE_URI
  • PostgreSQL 12+ required. PostgreSQL 16+ recommended for pg_stat_io metrics.

Agent Decision Tree: Where to Start

Is the I/O problem...
  |
  +--> GENERAL (overall slow, high iowait)?
  |    --> Start with Step 1 (Buffer Pool) then Step 5 (Checkpoints)
  |
  +--> QUERY-SPECIFIC (one slow query with high blks_read)?
  |    --> Start with Step 2 (Table I/O) then Step 3 (Index I/O)
  |
  +--> TEMP-FILE RELATED (sort/hash spilling to disk)?
  |    --> Start with Step 4 (Temp Files)
  |
  +--> CHECKPOINT RELATED (log warnings about checkpoints)?
  |    --> Start with Step 5 (Checkpoints)
  |
  +--> UNKNOWN?
       --> Start with Step 1 (Buffer Pool) for overall picture

I/O Investigation Workflow

Step 1: Buffer Pool Analysis

Tool: analyze_disk_io_patterns
Parameters:
  analysis_type: "buffer_pool"
  top_n: 20

Read the full file on GitHub · 311 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. 8d ago First seen · 311 lines · 67 tokens per session scan A a902ecf51063

Subscribe to this mod's changes

pg-io-deep-dive is a skill published in the GitHub repository isdaniel/pgtuner_mcp (29 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 67 tokens to every session and 2,610 once invoked, about $0.0003 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-08-30.