neon-postgres-egress-optimizer

Analyze pg_stat_statements to identify and reduce PostgreSQL egress data transfer.

Updated Apr 2, 2026
One-click install
npx skills add https://github.com/andrelandgraf/caspers-kitchen --skill neon-postgres-egress-optimizer-andrelandgraf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: neon-postgres-egress-optimizer
Source: https://github.com/andrelandgraf/caspers-kitchen/tree/main/.agents/skills/postgres-egress-optimizer
Command: npx skills add https://github.com/andrelandgraf/caspers-kitchen --skill neon-postgres-egress-optimizer-andrelandgraf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

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 overfetching, reduce Neon costs, optimize database usage, or wants to reduce data sent from their database to their application. Also use when reviewing query patterns for cost efficiency, even if the user doesn't explicitly mention egress or data transfer.

Core Features & Use Cases

  • Identify top egress contributors using pg_stat_statements.
  • Suggest code-level fixes: limit SELECT columns, add pagination, cache static data, push aggregations into SQL when appropriate.
  • Use Case: Example scenarios include dashboards or APIs that fetch wide JSON/TEXT data.

Quick Start

Diagnose and optimize data-transfer patterns in your application by analyzing top offending queries and applying targeted SQL rewrites.

Frequently Asked Questions about neon-postgres-egress-optimizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce high Neon Postgres egress costs from large queries?

Reduce Neon Postgres egress costs by analyzing query patterns with pg_stat_statements to pinpoint data-transfer offenders, then applying targeted SQL rewrites, pagination, and caching to minimize transferred data.

What causes unexpected database data transfer spikes in Postgres?

Unexpected Postgres data transfer spikes are often caused by large, wide-row queries like SELECT * operations that overfetch data. Analyzing pg_stat_statements helps identify these top egress contributors driving up network charges.

How do I find which queries are causing the most egress in my Postgres database?

Find top egress-causing queries in your Postgres database by inspecting pg_stat_statements to pinpoint offenders with high data-transfer patterns, enabling targeted rewrites and SQL-level optimizations to reduce transferred data.

What is the best way to optimize SELECT * queries to lower database network transfer charges?

The best way to optimize SELECT * queries and lower database network transfer charges is to limit selected columns, add pagination, cache static data, and push aggregations directly into SQL to bound query results.

Can I use pg_stat_statements to fix high Neon bills from wide JSON or TEXT data fetches?

Yes, you can use pg_stat_statements to diagnose high Neon bills caused by wide JSON or TEXT data fetches. It identifies top egress contributors so you can implement code-level fixes like limiting columns and adding pagination.

When should I review query patterns to reduce data sent from my database to my application?

Review query patterns to reduce data sent from your database when you notice high database bills, unexpected egress spikes, or cost jumps. Enforce inspection of data-transfer patterns and apply bounds on results to minimize transferred data.