MySQL Forums
Forum List  »  Newbie

Re: Select ALL columns and EXCLUDE a specified column
Posted by: Phillip Ward
Date: October 17, 2016 05:03AM

As Barry has already said: "Never use SELECT * in Production code".

Or, IMHO, any code for that matter.

Databases are inherently shared artefacts, which means that, over time, you won't be the only person defining structures within it.

Their Requirements will be very different from yours and they will do whatever they need to do, when they need to do it, and probably without consulting you.

So, if they decide that they need to extend that tidy little table of yours, that currently has 3 INTEGER columns, by adding another 46 TEXT columns containing Gigabytes of "stuff", then suddenly your code that does a "select *" on that table begins to perform horribly badly.

Only ever ask for the columns that you need.

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
Re: Select ALL columns and EXCLUDE a specified column
October 17, 2016 05:03AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.