HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Storing statistic results

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
statisticresultsstoring

Problem

I'm doing a small database for statistics, it's a really simple statistic like calculating the cost of an event and divide it by the amount of people that went to get the cost per attendee, but it can end up having loads of event, and it will require to poll in a lot of results at once.

I know with MySQL I can use the database to do such simple calculation, so I could run a query every time is needed, but it can end up being costly, if there's a lot of events in say a year.

My question is if I were to store the statistic results on a different table, I see it a little bit as data duplication, is that acceptable? or should I do it in a different manner?

Thanks

Solution

Data duplication as your are proposing is certainly not illegal. You can do what you like with your data.

You need to weigh the benefits of having the statistic statically stored and using up storage space, or having to calculate it each time.

Context

StackExchange Database Administrators Q#50881, answer score: 3

Revisions (0)

No revisions yet.