eveseat / seat

🌀✳️ SeAT: A Simple, EVE Online API Tool and Corporation Manager
https://eveseat.github.io/docs/
GNU General Public License v2.0
425 stars 143 forks source link

New change in 4.16.0 - Total Ratted Stats is causing greater load times than intended. #853

Closed veteranmina closed 2 years ago

veteranmina commented 2 years ago

In the current state that the ratting totals are calculated it is running a sum for all time. Testing with a database containing ~2500 characters and multi-year old database (Zed's Motorcycle in discord) confirms limiting this down to 7 days still results in close to 20 seconds of 'hang time' to complete.

My SeAT instance with just 170 unique characters in this table results in sub 5 second full sum of all unique grouped results. This instance however is less than a year old.

With the statement current as is this took more than several minutes, limiting to 1 month was over 6 minutes to complete.

https://github.com/eveseat/web/blob/c9117941c9ddb5661e9daa7ad1263fc8e84df989/src/Traits/Stats.php#L71