Hello all,
I have a website that calculates a users involvement/activity using multiple MySQL queries.
For a typical user I will ask:
How many updates have they made? How many photos have they uploaded? etc etc.
These are just basic COUNT queries on the relevant tables, updates, photos. I then total the COUNT values of each to get a score. Each query requires one JOIN and each query takes around 0.0006 seconds, 10 queries in total for each user, 0.006 seconds in all.
While not so bad for one user, I have to calculate this for 100,000 users, for a theoretical processing time of 10 minutes and some 1,000,000 DB queries. It feels like I'm approaching the problem in the wrong way and was wondering if anyone had any ideas?
I had thought about storing the users score in their user record and incrementing it every time they carry out a particular action but it's not as flexible (I can't go back and see how many points were accrued on a certain day for instance).
Any help greatly appreciated!