Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use less report cache SQL when adding results #1618

Merged
merged 5 commits into from
Jul 7, 2021

Conversation

timopollmeier
Copy link
Member

@timopollmeier timopollmeier commented Jul 6, 2021

What:
When multiple results are added when handling an OSP get_scan response
or a host in a CVE scan, only one SQL statement each is run to update
the report and owner of the results and to update the end times of the
report_counts cache of the report.

Why:
This addresses AP-1495: Updating the report_counts for each result
can cause performance issues if the scanner returns a large amount of
results.

How did you test it:
By running a normal scan and a CVE one.

Checklist:

When multiple results are added when handling an OSP get_scan response
or a host in a CVE scan, only one SQL statement each is run to update
the report and owner of the results and to update the end times of the
report_counts cache of the report.

This addresses AP-1495.
@timopollmeier timopollmeier marked this pull request as ready for review July 6, 2021 14:40
@timopollmeier timopollmeier requested a review from a team as a code owner July 6, 2021 14:40
@bjoernricks bjoernricks merged commit 717f61e into greenbone:master Jul 7, 2021
@bjoernricks bjoernricks added the backport-to-oldstable This pull request will be backported to the oldstable branch label Jul 7, 2021
timopollmeier added a commit that referenced this pull request Jul 7, 2021
The parse_osp_report function did not use has_results before and there
is no modification_time to update in 21.04 and before.
timopollmeier added a commit that referenced this pull request Jul 7, 2021
The parse_osp_report function did not use has_results before and there
is no modification_time to update in 21.04 and before.
The CHANGELOG entry is also moved to 20.8.3 here.
bjoernricks added a commit that referenced this pull request Jul 8, 2021
Use less report cache SQL when adding results (backport #1618)
bjoernricks added a commit that referenced this pull request Jul 8, 2021
Use less report cache SQL when adding results (backport #1618)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-oldstable This pull request will be backported to the oldstable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants