neon-postgres-egress-optimizer
Optimize Neon Postgres egress and data transfer
Developer Setup
Setup & Installation
npx skills add https://github.com/neondatabase/agent-skills --skill neon-postgres-egress-optimizernpx skills add https://github.com/neondatabase/agent-skills --skill neon-postgres-egress-optimizerOverview
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.
Application
When to use this Skill
- Configuring integration settings for custom agent workflows.
- Optimizing query execution and response latency in production.
- Developing clean, standard-compliant implementations for enterprise services.
- Troubleshooting connection timeouts and authentication handshakes.
- Monitoring API rate limits and execution pipelines programmatically.
Documentation
Show Skills.md file
Postgres Egress Optimizer
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 pg_stat_statements extension.
Check if pg_stat_statements is available
SELECT 1 FROM pg_stat_statements LIMIT 1;
If this errors, the extension needs to be created:
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
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:
Recommendations
Explore other random skills
plan-ceo-review
CEO/Founder plan review with four modes: Expansion, Selective Expansion, Hold Scope, Reduction
plan-eng-review
Eng Manager review: lock in architecture, data flow, diagrams, edge cases, and tests
plan-design-review
Senior Designer review: rates each design dimension 0-10, explains what a 10 looks like, AI Slop detection