On Wed, Jun 7, 2017 at 9:04 AM, Michael Madigan mmadi10699@yahoo.com wrote:
Yes, I was just wondering since it doesn't have to do the calculation every time it updates
But you have to do the calculation for the denormalized balance field you're putting into the table, every time you update any records principal, payments or adjustments. And denormalization brings along other dangers.
I *think* every index expression is evaluated each time a record is updated, for that one record only. But the amount of time to do a three-element addition of the record in memory is pretty inconsequential in the big scheme of things.
As always, the only way to determine how it works in your system on your hardware with your data is to test it in that environment. Book chapters and magazine columns have been written on performance optimization, and sometimes it's not as intuitive as you'd think. Reality has a funny way of not conforming to theory. DELETED() tags always speed up queries, until they don't. My favorite J Booth, "Sometimes you have to go slower to go faster."
Is there a performance problem you're trying to solve, or was this just idle curiousity?