Simeon Griggs [@simeonGriggs] | May 14, 2026Name something in recent history that got better and cheaper (other than the TVs at the entrance of Costco). I'll wait.Better performance and lower costs rarely come together, but optimizing your queries to reduce egress gives you both.So once you hit scale, or ideally before scale bites you, improving the efficiency of your queries by making the responses smaller and their frequency lower can pull off a rare double: make your application faster and cheaper.DefinitionsEgress: Data transferred out from your database over the public internet. Most cloud providers bill for this, so it's something we want to minimize.Ingress: Data transferred into your database over the public internet. Most cloud providers either do not bill for this, or do so only in specific scenarios.PlanetScale includes 100GB of egress on High Availability (HA) plans. Non-HA $5/month Postgres includes 10GB of egress. Usage is metered beyond those allowances, so it's worth knowing about and minimizing where possible.This post focuses largely on Postgres, but the general principles apply to all databases across all the major cloud providers.Common culpritsIf your egress numbers are approaching the included quota, or exceeding it by more than you’d like, your problems likely stem from two things: you're either fetching too much, too often, or both.Consider the case of a content-heavy application. The database is full of documents made of rich text and block content. That content is stored in a JSONB column using the Portable Text specification.CREATE TABLE posts (