- Регистрация
- 1 Мар 2015
- Сообщения
- 1,481
- Баллы
- 155
SQL gives us the handy SELECT * to quickly grab all columns from a table but should we really use it in production?
Some developers love the speed and convenience of SELECT *, especially during prototyping or when working with wide tables. Others argue it leads to performance issues, tight coupling, and unreadable queries and insist on selecting only the columns you actually need.
Quick and dirty
SELECT * FROM users;
More controlled
SELECT id, name, email FROM users;
Some developers love the speed and convenience of SELECT *, especially during prototyping or when working with wide tables. Others argue it leads to performance issues, tight coupling, and unreadable queries and insist on selecting only the columns you actually need.
Quick and dirty
SELECT * FROM users;
More controlled
SELECT id, name, email FROM users;
Do you prefer SELECT * or writing explicit column names in your queries?
Have you ever run into a real world issue because of SELECT *?
What do you think is the best practice, and why?