Im designing a databse for my cricket club to record the results of matchs which will eventually be used in a website so that users can query the databse and view statistics.
My question - is there a best practice concerning what should be put in a table and what should be generated dynamically?
For example Every player will have their own statistics (avg run rate, high score etc) and every cricket season will also have its own statistics ( season avg run rate, season high score etc) and every match will also have its own statistics (game avg runs, game high score, etc).
So far I have included these statistics as attributes (columns) in my tables and thought that I would have a series of triggers that would fire and update the stats when new data is entered once a week after the game and then on the website when a user wishs to view a statistic instead of calculating them I could just do a simple select from a table.
Of course the alternative is that te statistics are calculated when the user requests them - this seems like it would be processor heavy to me.
It's along the same lines as the rules for normalization - Normalize the database to the greatest extent possible, only denormalize when necessary to improve performance.
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert