neon-postgres-egress-optimizer
Skill by sickn33
Diagnoses and fixes excessive Postgres egress in a codebase. It is aimed at developers and teams on Postgres, especially Neon, who see unexpected network transfer bills.
Install neon-postgres-egress-optimizer
Built from the published package, never by AI.
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.claude/skills && cp -r /tmp/agentic-awesome-skills/skills/neon-postgres-egress-optimizer ~/.claude/skills/neon-postgres-egress-optimizerRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install neon-postgres-egress-optimizer in Claude Code
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/agentic-awesome-skills/skills/neon-postgres-egress-optimizer ~/.gemini/antigravity-cli/skills/neon-postgres-egress-optimizerAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install neon-postgres-egress-optimizer in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
The neon-postgres-egress-optimizer skill guides an assistant through finding and fixing application query patterns that cause excessive Postgres network transfer, known as egress. It starts by reading pg_stat_statements to rank queries by rows returned and call counts, then checks the codebase for unbounded or wide SELECTs, repeated reads, and application-side aggregation.
Fixes include selecting only needed columns, adding LIMIT and pagination, caching frequently called static queries, pushing aggregates into SQL, and splitting JOINs that repeat parent data. The skill also covers verification steps and a neon.ts configuration for cheaper non-production branches. It is aimed at developers and teams using Postgres, particularly Neon, who see unexpected egress bills.
Written from the project's SKILL.md and checked against it.
What it can do
- Diagnose top egress queriesRanks queries by total rows, rows per call and call frequency using pg_stat_statements.
- Check codebase queriesReviews queries for unused columns, missing pagination, frequent static reads and app-side aggregation.
- Fix unused columnsReplaces SELECT * with only the columns the response needs.
- Add paginationAdds LIMIT and OFFSET to unbounded list queries and suggests documenting the parameters.
- Push aggregation into SQLMoves averages, counts and sums from application loops into GROUP BY queries.
- Split duplicating JOINsReplaces a JOIN that repeats parent data with two separate queries.
- Configure non-production branchesShows a neon.ts config with TTL, scale-to-zero and autoscaling limits for dev and preview branches.
What you need
- Access to the Postgres database
- pg_stat_statements extension, which may need CREATE EXTENSION on Neon
- npm to install @neon/config for neon.ts
- Neon CLI for neon config apply
Try asking
- Find the queries causing the most egress in my Postgres stats
- Review my product list endpoint for missing pagination and unused columns
- Move the review averages in my app into a SQL GROUP BY query
Good to know
- pg_stat_statements counts rows, not network bytes, so rankings are hypotheses to check against billing metrics.
- Stats clear when a Neon compute scales to zero and restarts.
- Extension creation, stat resets and neon config apply are mutations that need explicit approval.
- Configured TTL can delete branches, so check the branch and backup policy first.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/neon-postgres-egress-optimizer/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md10 KB
Alternatives to neon-postgres-egress-optimizer
All alternatives →Creates, configures and manages datasets on the Hugging Face Hub, including SQL-based querying and transformation. Built for people who edit dataset content and metadata directly, alongside the HF MCP server.
Diagnoses and repairs gbrain's Postgres access when a command or MCP result shows a GBRAIN_DB_ACCESS marker, or when the operator reports the brain database is down. It runs the hardcoded gbrain db-repair ladder and verifies the result with a re-probe.
Manages clusters, instances, and backups for AlloyDB for PostgreSQL. Built for creating, configuring, and administering AlloyDB databases, not general PostgreSQL or Cloud SQL instances.
Writes, reviews and migrates Supabase logs queries against the ClickHouse logs table served by the logs.all.otel endpoint. Built for developers who write Logs Explorer SQL or convert older BigQuery logs queries.
Diagnoses and fixes slow Paperclip PostgreSQL queries using Cloud and Neon evidence, local benchmarks, regression tests, and a pull request with passing checks. Built for engineers working on Paperclip.
Guides AI assistants through Prisma 8 projects built on @prisma/orm-postgres, @prisma/orm-sqlite, or @prisma/orm-mongo. It covers data contracts, migrations, typed queries and runtime setup for developers on Prisma 8.
Compare with hugging-face-datasets, db-repair or alloydb-basics
neon-postgres-egress-optimizer: common questions
What causes high Postgres egress according to this skill?
The skill says most high egress bills come from the application fetching more data than it uses. Common causes include SELECT *, unbounded list queries and wide rows.
Can I use this without access to production statistics?
Yes. If no production stats are available, the skill says to analyze the codebase directly, since code-level patterns are often enough to find the worst offenders.
Does the skill change my database automatically?
No. The source says extension creation, statistic resets and neon config apply are mutations that need the matching scope, and that fixes need verification with tests and approval for costly actions.
How do I install neon-postgres-egress-optimizer?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is neon-postgres-egress-optimizer free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is neon-postgres-egress-optimizer safe to use?
It scores 89 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to neon-postgres-egress-optimizer?
Similar skills: hugging-face-datasets, db-repair, alloydb-basics, clickhouse-logs-queries.
