foundy_by: optimize for dedupe#13888
Merged
Maffooch merged 3 commits intoDefectDojo:bugfixfrom Dec 15, 2025
Merged
Conversation
Maffooch
approved these changes
Dec 15, 2025
blakeaowens
approved these changes
Dec 15, 2025
Jino-T
approved these changes
Dec 15, 2025
Maffooch
pushed a commit
to valentijnscholten/django-DefectDojo
that referenced
this pull request
Feb 16, 2026
* dedupe: optimize found_by * fix: update expected query counts in performance tests * fix: update expected query counts in performance tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
found_byfield of findings was updated on everysave()call. This is only needed for the initialsave().We can also prefetch it during batch dedupe and only modify it for duplicates when it's needed.
Users can still add/remove entries from
found_byas before.For imports without any duplicates we'll see 1 extra query, but for imports with X duplicates we'll see (X-1) less queries.
Doesn't affect Pro.