Agent skill · data analytics · sickn33

neon-postgres-egress-optimizer

Diagnose and fix excessive Postgres egress (network data transfer) in a codebase.

Why this skill is useful

Provides domain-specific knowledge on diagnosing and optimizing Postgres egress issues that the AI wouldn't reliably generate on its own.

What it needs

About 6k tokens when loaded. Last updated 2026-08-07. 44,571 stars on the source repository.

What this skill does

Postgres Egress Optimizer When to Use Use this skill when you need diagnose and fix excessive Postgres egress (network data transfer) in a codebase. Use when a user mentions high database bills, unexpected data transfer costs, network transfer charges, egress spikes, "why is my Neon bill so high", "database costs jumped", SELECT optimization, query... Guide the user through diagnosing and fixing application-side query patterns that cause excessive data transfer (egress) from their Postgres database. Most high egress bills come from the application fetching more data than it uses. Step 1: Diagnose Identify which queries transfer the most data. The primary tool is the pgstatstatements extension. Check if pgstatstatements is available If this errors, the extension needs to be created: On Neon, it is available by default but may need this CREATE EXTENSION step. Handle empty stats Stats are cleared when a Neon compute scales to zero and restarts. If the stats are empty or the compute recently woke up: 1. Reset the stats to start a clean measurement window: SELECT pgstatstatementsreset(); 2. Let the application run under representative traffic for at least an hour. 3. Return and run the diagnostic queries below. If the user has stats from a production database, use those. If they have no access to production stats, proceed to Step 2 and analyze the codebase directly — code-level patterns are often sufficient to identify the worst offenders. Diagnostic queries Run these to identify the top egress contributors. Focus on queries that return many rows, return wide rows (JSONB, TEXT, BYTEA columns), or are called very frequently. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills sickn33/neon-postgres-egress-optimizer--3d5b0e

View the source on GitHub

Browse the @skills marketplace