From 7a21ed170729242e2820265ffc4948e3e645c9fb Mon Sep 17 00:00:00 2001 From: Daniel Krupp Date: Mon, 7 Oct 2024 14:33:33 +0200 Subject: [PATCH] Speeding up store by removing nested query --- web/server/codechecker_server/api/mass_store_run.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/server/codechecker_server/api/mass_store_run.py b/web/server/codechecker_server/api/mass_store_run.py index 87ab4e2a52..71e21d9dc2 100644 --- a/web/server/codechecker_server/api/mass_store_run.py +++ b/web/server/codechecker_server/api/mass_store_run.py @@ -1319,11 +1319,12 @@ def get_skip_handler( .join(DBReport, DBReport.bug_id == ReviewStatusRule.bug_hash) \ .filter(sqlalchemy.and_( DBReport.run_id == run_id, - DBReport.review_status_is_in_source.is_(False), - ReviewStatusRule.bug_hash.in_(self.__new_report_hashes))) + DBReport.review_status_is_in_source.is_(False))) # Set the newly stored reports for review_status, db_report in reports_to_rs_rules: + if db_report.bug_id not in self.__new_report_hashes: + continue old_report = None if db_report.bug_id in report_to_report_id: old_report = report_to_report_id[db_report.bug_id][0]