Subject | calculated fields |
---|---|
Author | Ulrich |
Post date | 2003-04-20T08:53:56Z |
Hello,
not to calculate the amount of every bill stored in a table on every client
again and again, I thought about to calculate the amount of every stored
bill with a computed field. I do this with a stored procedure. I defined the
computed field as :
COMPUTED BY (((select AMOUNT from CALC_AMOUNT(BILL_ID))))
where CALC_AMOUNT(BILL_ID) is my stored procedure
It works fine, but if I rely on this method for my future development, my
question is : Is there a serious time-penalty, and when will it arise? The
table of bills will contain something between 10.000 to 50.000 records. The
table of the bill positions will contain between 100.000 and 1.000.000
records.
So, if I make a (select * from bill) the computed fields inside the bill
table will be calculated for every record??
The second possibility I thought about is, to have a real (I mean -not
computed) field inside the bill table, which I fill with the bill amount
(with the help of a stored procedure) only when the bill amount really
changes (with an on_update trigger on the bill table)
Any comments, or suggestions?
Ulrich
not to calculate the amount of every bill stored in a table on every client
again and again, I thought about to calculate the amount of every stored
bill with a computed field. I do this with a stored procedure. I defined the
computed field as :
COMPUTED BY (((select AMOUNT from CALC_AMOUNT(BILL_ID))))
where CALC_AMOUNT(BILL_ID) is my stored procedure
It works fine, but if I rely on this method for my future development, my
question is : Is there a serious time-penalty, and when will it arise? The
table of bills will contain something between 10.000 to 50.000 records. The
table of the bill positions will contain between 100.000 and 1.000.000
records.
So, if I make a (select * from bill) the computed fields inside the bill
table will be calculated for every record??
The second possibility I thought about is, to have a real (I mean -not
computed) field inside the bill table, which I fill with the bill amount
(with the help of a stored procedure) only when the bill amount really
changes (with an on_update trigger on the bill table)
Any comments, or suggestions?
Ulrich