Add missing join condition (#2586)

This commit is contained in:
Tomas Touceda 2021-10-20 13:24:51 -03:00 committed by GitHub
parent c3f7577bd8
commit 86b1926d7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -0,0 +1 @@
* Improve performance of software listing query.

View file

@ -236,7 +236,7 @@ func listSoftwareDB(ctx context.Context, q sqlx.QueryerContext, hostID *uint, te
SELECT DISTINCT s.id, scv.cve
FROM host_software hs
JOIN hosts h ON (hs.host_id=h.id)
JOIN software s
JOIN software s ON (s.id=hs.software_id)
JOIN software_cpe scp ON (s.id=scp.software_id)
JOIN software_cve scv ON (scp.id=scv.cpe_id)
WHERE %s AND %s