Group-level vulnerability report page performance improvements
We need to improve the performance of the group-level vulnerability report page for big groups containing lots of projects as the page is currently timing out for them constantly.
To improve the performance of that page, we will apply schema denormalization and [namespace key](https://gitlab.com/gitlab-org/gitlab/-/issues/430715#note_1654079754) approach.
The biggest issue for the group-level vulnerability page is that we are joining to the `projects` table to remove the records from the resultset for the archived projects. This requires reading all the records, joining the projects table, and removing the records which performs really badly. To achieve the same result, we can denormalize the project's archived attribute to the `vulnerability_reads` table and adjust the indices to remove the join.
In addition to this improvement, we can use the [namespace key](https://gitlab.com/gitlab-org/gitlab/-/issues/430715#note_1654079754) proposal to reduce the amount of buffer use and improve the execution time of the queries.
## Iterations
### MVC
1. Group level performance for large groups
- Denormalize fields - https://gitlab.com/gitlab-org/gitlab/-/issues/437667+s
- Use denormalize fields - https://gitlab.com/gitlab-org/gitlab/-/issues/438288+s
- Create and remove indices
- Migration - https://gitlab.com/gitlab-org/gitlab/-/issues/437675+s
- Feature flag rollout - https://gitlab.com/gitlab-org/gitlab/-/issues/455263+s
2. Export - https://gitlab.com/gitlab-org/gitlab/-/issues/440163+s
3. Fuzzy counts - https://gitlab.com/gitlab-org/gitlab/-/issues/438303+s
### Post-MVC
###
1. N+1 optimizations - https://gitlab.com/groups/gitlab-org/-/epics/13603
epic