2 ms·
There is no optimization to which you cannot apply that logic. You're claiming "always optimize everything, because we can never change code". Even in enterpris
by stickfigure 6y ago
There is no optimization to which you cannot apply that logic. You're claiming "always optimize everything, because we can never change code". Even in enterprise, this is nonsense.
This is classic premature optimization. You don't know that overselecting will have any significant performance impact, and barring a few obvious cases (LOBs) it's quite unlikely to matter. There's a material cost in complexity to add situation-specific SQL vs the aforementioned:
models = Model.where(column_name: column_val)
Most databases make it pretty easy to find out what queries are consuming resources. Spend your time optimizing those.
- ethbr0 6y agoThere are tons of optimizations that logic can't be applied to! For starters, any software developed in any company with the ability to deliver updates in a timely manner.