sqldatabase

Why is SELECT * considered harmful?


Why is SELECT * bad practice? Wouldn't it mean less code to change if you added a new column you wanted?

I understand that SELECT COUNT(*) is a performance problem on some DBs, but what if you really wanted every column?


Solution

  • There are really three major reasons:

    But it's not all bad for SELECT *. I use it liberally for these use cases: