Add traversal_ids and archived to vulnerability_statistics
What does this MR do and why?
Add archived
and traversal_ids
columns to vulnerability_statistics
table to resolve cross-database joins in ProjectGrades.grades_for
(when the vulnerable is a group) and EE::Group#vulnerability_scanners
.
These new columns make it possible to query vulnerability statistics and other tables of the gitlab_sec
schema
for all the projects a large group and its subgroup,
and without joining the projects
and namespaces
tables (of the main schema).
See proposal and implementation plan of the related issue (#512592 (closed)).
References
This is similar to Add `archived` and `traversal_ids` columns to `... (!143104 - merged) but the goal is different.
Instead of de-normalizing archived
and traversal_ids
for performance,
we do it to remove cross-database joins (involving gitlab_sec
and the main gitlab schema).
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
Related to #512592 (closed)