workflow/statistics.json as called by old AdminUI is very inefficient
Steps to reproduce
The old admin UI polls workflow/statistics.json to update the number of workflows in each category on the Recordings tab. The Admin UI is only concerned with the total WFs in each state and the state of operations in the Scheduling WF.
However the endpoint returns data for every operation in non-completed state for every workflow. This is a lot of unused data.
Further the calls to the workflowindex are very inefficient getting state counts for "every operation x workflow" => 100 queries
With a separate solr server the tomcat logs can grow very rapidly with a single admin window polling every 5s.
Finally the calls to workflow index do use the default row count of 10 so documents are returned for every query.
Obsolete. Opencast 2.x generates statistics in a slightly different way, including limiting the time period.
With this patch our calls to statistics.json have dropped from ~2000ms to ~150ms