Mayur B.: PostgreSQL Santa’s Naughty Query List: How to Earn a Spot on the Nice Query List?
postgr.es·5d
📈Query Optimization
Preview
Report Post

Santa doesn’t judge your SQL by intent. Santa judges it by execution plans, logical io, cpu utilization, temp usage, and response time.

This is a practical conversion guide: common “naughty” query patterns and the simplest ways to turn each into a “nice list” version that is faster, more predictable, and less likely to ruin your on-call holidays.

1) Naughty: SELECT * on wide tables (~100 columns)

Why it’s naughty

  • Wider tuples cost more everywhere: more memory bandwidth, more cache misses, bigger sort/hash entries, more network payload.
  • Index-only becomes impossible: if you request 100 columns...

Similar Posts

Loading similar posts...