Joined October 2012
·
Posted to
MySQL Query Optimization
over 1 year
ago
The first optimization feels potentially counter-productive. How much time and resources are REALLY being saved by selecting exactly what you need and not using *?
Compare this to the tradeoff: not using * introduces development overhead. If a column is changed, added, or removed, the query will have to be rewritten.
If you're developing for the web, then there are several other performance enhancements I would try before "selectively selecting." Eager loading, query caching, view caching (I come from a Rails background).
However, if you're writing some sort of background process that is fetching lots of data and needs a performance boost, I can see the value of foregoing SELECT *.
Achievements
45 Karma
0 Total ProTip Views
Mongoose
Have at least one original repo where Ruby is the dominant language
Forked
Have a project valued enough to be forked by someone else
Kona
Have at least one original repo where CoffeeScript is the dominant language
Charity
Fork and commit to someone's open source project in need
Choosing patterns to use in Javascript seems heavily dependent on your use case. Do you need a fancy, highly interactive frontend? Then you can be using "OO Javascript" in no time with Backbone.JS.
On the other hand, if you do not need the powers of a client-side MVC but still need code organization, I recommend trying to abstract some of the JS into jQuery plugins. And, on top of that, you can write your plugins in an OO fashion. Check out the Bootstrap jQuery plugins (https://github.com/twitter/bootstrap) for excellent examples of well-written plugins.