Hey Folks, is there a reason the mysql table `vuln...
# fleet
c
Hey Folks, is there a reason the mysql table
vulnerability_host_counts
does not have a primary key set? https://github.com/fleetdm/fleet/blob/main/server/datastore/mysql/migrations/tables/20240222135115_AddVulnHostCountsTable.go
k
Hi @Camilo We didn't explicitly set a primary key on this table since we're always pulling data based on the values covered by the unique key.
c
Thanks for explaining! I understand the reliance on the unique key, but I believe it's a good practice to set a primary key, especially for larger tables. In MySQL with InnoDB, primary keys are critical for performance optimization, data integrity, and scalability. Even if not immediately necessary, they can prevent potential issues in the future, such as replication or migration challenges.
Do you have any idea if something like this would work? Our main concerns is breaking the upgrade process if we start making changes directly in the DB.
k
I would definitely never recommend modifying the database directly.
This is excellent feedback though! Would you be up for submitting a GitHub ticket with your suggestion?
c
100%. Just a new issue?
@Kathy Satterlee I don't believe this is a bug on itself.. so I'm thinking maybe a FR?
Closing the loop on this one: Heres the feature request: https://github.com/fleetdm/fleet/issues/26006