Neon/neon-postgres-egress-optimizer — Agent Skills | officialskills.sh
Back to skills

neon-postgres-egress-optimizer

officialdata

Diagnoses and fixes Postgres query patterns that cause excessive data transfer from a database to an application.

Setup & Installation

npx skills add https://github.com/neondatabase/agent-skills --skill neon-postgres-egress-optimizer
or paste the link and ask your coding assistant to install it
https://github.com/neondatabase/agent-skills/tree/main/skills/neon-postgres-egress-optimizer
View on GitHub

What This Skill Does

Diagnoses and fixes Postgres query patterns that cause excessive data transfer from a database to an application. Works by analyzing pg_stat_statements output to find queries returning too many rows, too many columns, or running too frequently. Covers SELECT * abuse, missing pagination, JOIN duplication, and application-side aggregation.

Running pg_stat_statements diagnostics manually and mapping high-row queries back to application code takes hours; this skill walks through the exact SQL, the interpretation, and the fix for each pattern in one pass.

When to use it

  • Tracing a Neon bill spike to a specific unpaginated list endpoint
  • Replacing SELECT * with column-specific queries to cut transferred data
  • Finding queries called thousands of times daily that return static config data
  • Rewriting application-side aggregation loops into single SQL GROUP BY queries
  • Splitting wide JOIN results into two separate queries to eliminate row duplication