Re: SQL Theory/performance

From: Bill MacLean <bmaclean_at_worldnet.att.net>
Date: 1996/09/28
Message-ID: <324D426A.2107_at_worldnet.att.net>#1/1


John Parrott wrote:
>
> I have a record where the values of fields in the records depend on
> other fields in the same record.
>
> Eg. (Price * Quantity) + Tax = Amount
>
> If I have a table with all four fields, changing any one would mean the
> others have to change.

You may want to store derived data like "Amount" (above) if the derivation is time consuming, or if the derived amount is itself used in other calculations extensively, but I would consider this option carefully. Since storage of derived data is a form of denormalization, I always start with the plan of NOT storing derived data, and then denormalize only if I can find very specific reasons. If you decide not to store the derived data, you can create a VIEW that will show the derived columns.

Regarding your front end display, I am not familiar with Delphi, but I would imagine that you can just locate a calculated field on the screen that shows the derived amount to the user.

Thanks,

Bill MacLean Received on Sat Sep 28 1996 - 00:00:00 CEST

Original text of this message