Reduce SBoM table updates
What does this MR do and why?
Sbom tables have very high contention and we have been performing upserts for all records ingested. This causes a number of issues including:
- Excessive number of database writes
- Deadlocked queries due to conflicting locks on the same rows
- Extra pressure on the primary database node
This change attempts to reduce the number of database writes by not
performing upserts when inserting duplicate items. The ids for the
existing items are needed for subsequent steps in the ingestion process,
so we perform a SELECT
query afterwards in order to get these.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Brian Williams