I have a large user table in mysql with 50k+ entries. these users have limited download quota for their stored files in my website. currently the quota resets every 24 hours by resetting the traffic count in a seperate 'traffics' table (where each row has a userid and a trafficused field entry) so that makes two tables with 50k entries each (representing 50k users) this system is working fine so far, but I have no way of keeping a user's bandwidth usage history since to reset the quota per day, I have to clear the traffics table. I use php to update transferred bandwidth on each download completion. I need to be able to limit quota per day and/or per month as efficiently as possible without making a mess out of the mysql tables. There is another complication, I have seperate user quotas for different filetypes. for example .iso files have no quota, .mp4 files have 5gb per day limit. and .rar files have 10gb per day limit. and maximum user quota per day is 20gb.
I know it all sounds very confusing. I can post the table structures here if needed. Please try to help if you can. Thanks