mirror of
https://github.com/resf/distro-tools.git
synced 2024-12-22 10:58:28 +00:00
Make compat query faster
This commit is contained in:
parent
0c2e29785a
commit
a4b4c031b4
@ -161,6 +161,7 @@ async def fetch_advisories_compat(
|
||||
count(a.*) over () as total
|
||||
from
|
||||
advisories a
|
||||
left outer join advisory_affected_products ap on ap.advisory_id = a.id
|
||||
left outer join advisory_cves c on c.advisory_id = a.id
|
||||
left outer join advisory_fixes f on f.advisory_id = a.id
|
||||
where
|
||||
@ -173,7 +174,7 @@ async def fetch_advisories_compat(
|
||||
and ((select severity from vars) is null or a.severity = (select severity from vars))
|
||||
and ((select kind from vars) is null or a.kind = (select kind from vars))
|
||||
and ((select search from vars) is null or
|
||||
exists (select name from advisory_affected_products where advisory_id = a.id and name like '%' || (select product from vars) || '%') or
|
||||
ap.name like '%' || (select product from vars) || '%' or
|
||||
a.synopsis ilike '%' || (select search from vars) || '%' or
|
||||
a.description ilike '%' || (select search from vars) || '%' or
|
||||
exists (select cve from advisory_cves where advisory_id = a.id and cve ilike '%' || (select search from vars) || '%') or
|
||||
|
Loading…
Reference in New Issue
Block a user