Optimize software/versions endpoint database query #24236
Labels
~backend
Backend-related issue.
bug
Something isn't working as documented
~engineering-initiated
Engineering-initiated story, such as a bug, refactor, or contributor experience improvement.
#g-endpoint-ops
Endpoint ops product group
:incoming
New issue in triage process.
~released bug
This bug was found in a stable release.
Fleet 4.60.0 on Chrome 131.0.6778.86 running on macOS
💥 Actual behavior
When loading the https://dogfood.fleetdm.com/software/versions endpoint, the database query and post query processing causes a large amount of memory to be consumed in certain cases. See
listSoftwareDB
https://github.com/fleetdm/fleet/blob/main/server/datastore/mysql/software.go#L885. The query used joins thesoftware
table withsoftware_cve
andcve_meta
. So despite the UI table only having 20 records, the query can pull hundreds of rows from the database.🧑💻 Steps to reproduce
Find a software version that has many CVEs associated with it. You can use this query to identify which softwares have the most CVEs in your database:
🕯️ More info (optional)
Split from #23679
TBD
The text was updated successfully, but these errors were encountered: