Refactor for `/v2/action` performance improvements

Introduces some of the necessary framework for the final solution (synchronous refreshing of aggregates) together with temporary improvements (materialization of the "easy" part of the actions UNION). Together it makes the performance of /v2/actions acceptable with the most commonly used parameter combinations.

Merge request reports

Loading