Dev.to
6/29/2026

Egress problems and where to find them
Short summary
Database egress—data transfer costs—drains both your wallet and performance. Cloud providers bill by the byte, so optimizing queries to transfer less data achieves a rare double: faster apps and lower bills. This guide covers three concrete tactics: fetch specific columns instead of SELECT *, switch to cursor-based pagination instead of offset/limit, and audit ORMs like Drizzle for hidden RETURNING clauses that leak data during inserts. At scale, these changes typically cut egress costs by 50%+.
- •Fetch only the columns and rows you need (SELECT id, title vs SELECT *) to reduce transfer size
- •Use cursor pagination instead of offset/limit for consistent performance on large datasets
- •Audit ORMs for unexpected RETURNING clauses that leak data from insert operations
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



