N+1 Queries in vulnerability exports
Why are we doing this work
Ref: #432548 (comment 1694930046)
We did profiling of vulnerability export generation.
We can see that for each row, we are spending a lot of time in vulnerability.full_path, vulnerability.group_name, vulnerability.notes_summary, and vulnerability.project_name, and there are hits to database classes inside these nodes. This indicates that we have N+1 queries when reading these fields.
For group exports that have thousands of vulnerabilities, this is probably making the export literally 20-50 times slower.
Relevant links
Non-functional requirements
-
Documentation: -
Feature flag: -
Performance: -
Testing:
