Description
neon-postgres-egress-optimizer is an agent skill that finds and fixes Postgres query patterns that move too much data from the database to your application. It works from pg_stat_statements output, which records each query, and looks for queries that return too many rows, too many columns or run too often. The skill covers four common problems: SELECT * used where a few columns would do, missing pagination on list endpoints, JOIN duplication that multiplies rows, and aggregation done in application code instead of in the database. For each pattern it walks through the SQL to run, how to read the result, and the fix. The page says that running these diagnostics by hand and matching high-row queries to application code can take hours, and the skill is meant to do it in one pass. Typical tasks are tracing a spike on a Neon bill to a particular unpaginated list endpoint, replacing SELECT * with column-specific queries, and finding queries that run thousands of times a day only to return static configuration. Install it with the command shown on this page.…
Highlights
- Analyzes pg_stat_statements output
- Finds queries returning too many rows or columns
- Covers SELECT * and missing pagination
- Fixes JOIN duplication
- Moves aggregation into the database
Ratings & Reviews
No ratings yet
Be the first to rate neondatabase/neon-postgres-egress-optimizer.
People also visit

neon-postgres-egress-optimizer
Diagnose and fix excessive Postgres egress (network data transfer) in a codebase

postgres-patterns
PostgreSQL database patterns for query optimization, schema design, indexing

database-optimizer
Optimizes database queries and improves performance across PostgreSQL

clickhouse-managed-postgres-rca
MUST USE when investigating performance issues on a ClickHouse-managed Postgres
neondatabase/neon-postgres-egress-optimizer FAQ
What does this skill do?
It finds Postgres queries that transfer too much data to the application and shows how to fix them.
How do I install it?
Run npx skills add https://github.com/neondatabase/agent-skills --skill neon-postgres-egress-optimizer, or paste the skill link into your coding assistant and ask it to install the skill.
What data does it use?
The output of pg_stat_statements, which the page says it analyzes to find queries that return too many rows, columns or calls.
What patterns does it cover?
SELECT * abuse, missing pagination, JOIN duplication and application-side aggregation.
What are the best neondatabase/neon-postgres-egress-optimizer alternatives?
Popular alternatives to neondatabase/neon-postgres-egress-optimizer include postgres-pro, neon-postgres-egress-optimizer and postgres-patterns. See all neondatabase/neon-postgres-egress-optimizer alternatives








