Create compound index for vulnerabilities table on project_id, severity & state
This is a followup issue for !36040 (merged). Please see the discussion here: !36040 (comment 376967397).
We can also create a partial index only for states (1, 4)
which will make the index size smaller.
Implementation plan
-
backend add index on project_id
,state
andseverity
tovulnerabilities
table:
CREATE INDEX index_vulnerabilities_on_project_id_state_and_severity ON public.vulnerabilities USING btree (project_id, state, severity);
-
backend consider creating partial index instead to cover only 1 and 4 states ( detected
,confirmed
)
Edited by Mehmet Emin INAC