MySQL Forums
Forum List  »  Newbie

Re: optimised way
Posted by: Phillip Ward
Date: March 15, 2011 06:56AM

Write all 34 field names in the query.
Always specify your columns explicitly. You cannot know when someone [else] will add another 70, gigantic columns to the table. If you're retrieving every field ("select *" <shudder/>), your data retrieval rate will suddenly plunge through the floor, even though you haven't changed anything at the application end.

All that said, if it's always the same 34 columns you need, you could create a View that sits on top of your Table, retrieving just those columns. Your application then selects from the View (and people can add whatever they like to the table without upsetting your application).

Regards,
Phill W.

Options: ReplyQuote


Subject
Written By
Posted
March 15, 2011 05:36AM
Re: optimised way
March 15, 2011 06:56AM
March 15, 2011 06:58AM


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.