Description:
You need two fields, but SELECT * drags all twenty. Looks harmless. Here's the real bill:
1️⃣ Wasted traffic: the database reads and ships avatars, settings and bios your code never touches.
2️⃣ Index bypassed: a two-column query could be answered straight from a covering index. The star forces a trip to the table.
3️⃣ Prod breakage: someone adds a column, and code that read rows by position suddenly gets the wrong data.
One cure: list only the columns you need.
Still shipping SELECT * to prod?
More walkthroughs — sql-academy.org
#sql #postgresql #backend #performance #bestpractices
Share this link via
Or copy link























