Problem
Legacy reports ran complicated database jobs and took many minutes to generate results.
In addition to this the reports put a huge demand on server resources slowing all other requests
sometimes to a crawl. It was possible to crash the server for all users by running some of the hockey statistic
reports with long date ranges.
Action
An extensive review of all of the reports and the database queries for the reports identified
a large number of sql and code fixes to speed up the reports and reduce memory usage on the server.
Compiling sums from multiple tables into a single set of records also reduced resource usage and
speed up all requests on the system.
Solution
Reports ran under a second and exports to excel functioned as expected.
Users could then review and download team stats. The site no longer crashed and
slow downs ceased to happen when reports were run. Support calls were reduced.