forked from eclipse-apoapsis/ort-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(dao): Compare packages in a single query
The `findByPackage` function of the `PackageDao` compares a `package` to already stored packages to find any duplicates. The previous implementation used separate queries for all existing tables, which could result in a huge amount of queries, especially when many packages with almost identical metadata are already stored in the database. The comparison is replaced with a single query that loads all relevant data, significantly reducing the amount of queries executed when storing packages. If the query finds a duplicate, the DAO API is still used to load the data to simplify the code. This could be further optimized, but for now the most important change is to improve the performance of finding duplicates. Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@bosch.com>
- Loading branch information
1 parent
59d0a6f
commit d837499
Showing
3 changed files
with
103 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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