neon-postgres-egress-optimizer

Diagnose and fix Postgres query patterns causing excessive database egress costs.

Updated Sep 2, 2026
One-click install
npx skills add https://github.com/akira777777/vladfsBET --skill neon-postgres-egress-optimizer-akira777777
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: neon-postgres-egress-optimizer
Source: https://github.com/akira777777/vladfsBET/tree/main/.grok/skills/neon-postgres-egress-optimizer
Command: npx skills add https://github.com/akira777777/vladfsBET --skill neon-postgres-egress-optimizer-akira777777

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? High database bills often come from applications transferring far more data than they use. This Skill identifies which queries cause excessive Postgres egress and fixes the underlying code patterns, reducing network transfer charges on platforms like Neon. ## Core Features & Use Cases - Egress Diagnosis: Uses pg_stat_statements to rank queries by total rows returned, rows per call, call frequency, and execution time. - Anti-Pattern Fixes: Corrects SELECT * overfetching, missing pagination, uncached high-frequency queries, application-side aggregation, and JOIN data duplication. - Verification Workflow: Re-measures query stats after fixes to confirm data transfer actually dropped without breaking API responses. - Use Case: Your Neon bill jumped unexpectedly. Run the diagnostic queries, find an unpaginated endpoint returning 10,000 rows per request, add LIMIT/OFFSET pagination, and verify the transfer reduction. ## Quick Start Analyze my database queries and codebase to find what is causing my high Neon egress bill and fix the worst offenders.

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 my Neon database egress costs?▼

Use pg_stat_statements to find queries returning the most rows, then fix the code behind them: select only needed columns, add LIMIT pagination, cache static data, push aggregation into SQL, and split wide JOINs into separate queries.

How to find which Postgres queries transfer the most data?▼

Query pg_stat_statements ordered by total rows descending to see the biggest row producers. Also check rows per call for poorly scoped SELECTs and call frequency for caching candidates.

Why is my Postgres bill so high even with a small database?▼

Egress charges depend on data transferred, not storage size. Unpaginated endpoints, SELECT * on wide JSONB columns, and high-frequency queries on static data can transfer gigabytes daily from small tables.

Does pg_stat_statements work on Neon?▼

Yes, pg_stat_statements is available by default on Neon but may still need CREATE EXTENSION. Note that stats reset when a compute scales to zero, so reset stats and measure under representative traffic for at least an hour.

When should I split a JOIN into two queries?▼

Split a JOIN when a wide parent table joins a child table with many rows, since parent columns duplicate across every child row. Two separate queries fetch each dataset once, eliminating the duplication.