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

Improve report counts performance #1438

Merged

Conversation

timopollmeier
Copy link
Member

@timopollmeier timopollmeier commented Mar 8, 2021

What:
This improves the performance of creating the report counts cache by removing unused permission check WITH clauses from the SQL and instead using WITH clauses for the overrides.

Why:
Updating the report counts cache is slow, especially when updating overrides.

How did you test it:
By running the modify_override GMP command and viewing various pages in GSA like results and reports.

Checklist:

When counting unfiltered report result severities, the WHERE access
check queries for the results are not used, so they can be omitted to
improve performance.
The init_result_get_iterator_severity function now uses WITH clauses for
the permissions in the valid_overrides.
@timopollmeier timopollmeier marked this pull request as ready for review March 8, 2021 15:47
@timopollmeier timopollmeier requested a review from a team as a code owner March 8, 2021 15:47
It should only be attempted to free the WITH clause if the output
parameter for it is not NULL.
@nichtsfrei nichtsfrei merged commit 2faa6db into greenbone:gvmd-20.08 Mar 10, 2021
@timopollmeier timopollmeier added backport-to-oldstable This pull request will be backported to the oldstable branch backport-to-21.04 backport-to-main This pull request will be ported to the master branch and removed backport-to-oldstable This pull request will be backported to the oldstable branch labels Mar 10, 2021
@timopollmeier
Copy link
Member Author

@Mergifyio refresh

@mergify
Copy link
Contributor

mergify bot commented Mar 10, 2021

Command refresh: success

Pull request refreshed

timopollmeier added a commit that referenced this pull request Mar 15, 2021
The WITH clause code in init_result_get_iterator_severity has been moved
into an if block and the scope of some variables has changed
accordingly.
timopollmeier added a commit that referenced this pull request Mar 15, 2021
The WITH clause code in init_result_get_iterator_severity has been moved
into an if block and the scope of some variables has changed
accordingly.
nichtsfrei added a commit that referenced this pull request Mar 17, 2021
timopollmeier added a commit that referenced this pull request Mar 17, 2021
@timopollmeier timopollmeier deleted the report-counts-performance branch October 15, 2021 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-main This pull request will be ported to the master branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants