6 ms·
select * can also be bad if you have any sort of system that expects or uses your columns by index. someone changes up your database, adds a column or some such
by groundCode 13y ago
select * can also be bad if you have any sort of system that expects or uses your columns by index. someone changes up your database, adds a column or some such and all of a sudden your consuming code breaks all over the place.
- nbouscal 13y ago> if you have any sort of system that expects or uses your columns by index. Of course if you have that sort of system, select * is the least of your worries.
- VLM 13y agoYou can also experience severe performance degradation (both server and client) if someone adds an absolutely huge binary column. Perhaps an example of table checking_account_register hmm lets add a new feature, after a paper check is cancelled we'll scan it into an image file and stick it in the database. Suddenly you get giant TIFF for each row returned, surprise! Of course a better spot Might be a separate scan table linking checks to an image of the check (perhaps multiple images, multiple scan attempts, multiple sides of the check, and all that), but for the sake of argument, etc. I think probably more databases get killed by processing load via no WHERE or LIMIT clause than from using a * as a column list... probably. With a close second of gathering way too much data and weeding it out in a HAVING.
- DrJokepu 13y agoOf course, adding large binary blobs to a relational database is almost certainly a bad idea anyway. It’s just not meant to be. You can achieve transactionality by other means and it won’t actually make managing and backing up data easier because suddenly database backups are an awful lot larger.
- deleted 13y ago[deleted]