Improve performance of Security Report storage with bulk insert/upsert
Problem to solve
Security Report storage algorithm currently uses N+1 queries and find_or_create_by
calls which is not the most performant approach.
Further details
(Include use cases, benefits, and/or goals)
Proposal
Replace these queries with bulk insert and upsert.
What does success look like, and how can we measure that?
Store Security Reports with ~1 query per table instead of the current N+1 scheme.
Links / references
Edited by Olivier Gonzalez