Skip to content

Fix group-level vulnerabilities GraphQL performance issue

What does this MR do and why?

This fixes the performance issue of paginated vulnerabilities GraphQL query which was caused due to an interesting behavior of PostgreSQL. Basically, if you have a predicate like the following, PostgreSQL does not cancel the query and uses too many shared buffers to find a matching record;

WHERE severity = 7 AND (severity, id) < ROW(6, 21321321);

In this query, the DBMS returns 0 records because severity = 7 AND severity < 6 predicates won't match any record but it uses too many shared buffers for such a query.

The solution is to remove severities greater than the one used in the ROW predicate.

Related to Group-level vulnerability report page query is ... (#479353 - closed).

Edited by Mehmet Emin INAC

Merge request reports

Loading