Return only the columns you need.
Section: Join performance
Avoid SELECT * in wide join queries
sql
sql
SELECT c.customer_id, c.name, o.order_id, o.total_amount
-- not SELECT *Explanation
Narrow projections reduce memory, network transfer, and sort/hash costs.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Join performance
Use EXPLAIN to inspect join strategy
Check whether the planner uses indexes, hash joins, merge joins, or nested loops.
Reduce row counts before large joins
Filter or aggregate early when possible.