Pauldohert
Something in here
- Local time
- Today, 00:02
- Joined
- Apr 6, 2004
- Messages
- 2,101
Calaculated fields should never be stored in a database. Is this always the case -
For example if I am asked how old I am - I simple answer with the age I have stored in my mind, I don't calculate the differance in years between today and the day I was born. ( i know as I get older - I do have to do this on occasions ) Simply storing my age is easier than the calculation everytime. (i am not suggesting storing ages against in an actual database) - is it not a good idea to store a calculated value if the calcualtion is harder to perform.
Or I currently have 100 people in a study with an average IQ of 100 - I add one more person to the study who has an IQ of 140. I don't need to do the calculation again of adding all 101 persons IQs and dividing by 101. Just to times the average by the 100 add 140 and divide by 101.
(again in this example I am not suggesting this is a good idea to store in an actual database) - but at a certain point (many times more powerful a computer may be), is a calculated field more efficient than calculating the value, even in a database?
For example if I am asked how old I am - I simple answer with the age I have stored in my mind, I don't calculate the differance in years between today and the day I was born. ( i know as I get older - I do have to do this on occasions ) Simply storing my age is easier than the calculation everytime. (i am not suggesting storing ages against in an actual database) - is it not a good idea to store a calculated value if the calcualtion is harder to perform.
Or I currently have 100 people in a study with an average IQ of 100 - I add one more person to the study who has an IQ of 140. I don't need to do the calculation again of adding all 101 persons IQs and dividing by 101. Just to times the average by the 100 add 140 and divide by 101.
(again in this example I am not suggesting this is a good idea to store in an actual database) - but at a certain point (many times more powerful a computer may be), is a calculated field more efficient than calculating the value, even in a database?
Last edited: