4 ms·
So long as everyone, everywhere, always remembers to calculate it in the same way for all inserts and updates. This seems a lot more robust to me.
by yourad_io 7y ago
So long as everyone, everywhere, always remembers to calculate it in the same way for all inserts and updates.
This seems a lot more robust to me.
- GordonS 7y agoYou can use abstractions that push such code out of the developers concern, into the "code infrastructure" layer. But there are also plenty times where I'd rather compute at the database side; there are no silver bullets.
- magicalhippo 7y agoAnd then someone at support comes along and updates the data via SQL and forgets to update the derivative field because he got woken up at 2am for an emergency. Using a computed column ensures the data is consistent.