Why is SELECT * discouraged in production code?

SQL SELECT, filtering and sorting · Experienced

Model answer

It transfers unneeded data, can prevent index-only scans, and breaks code when columns are added or reordered. List the columns you need. It is fine for quick exploration.

Learn this topic

SELECT, FROM and WHERE: Your First Queries in the course SQL for Beginners: Learn Databases Step by Step.

Sign in to add your own answer.

More questions