Duplicate database indexes #18191
Labels
status: accepted
This issue has been accepted for implementation
type: housekeeping
Changes to the application which do not directly impact the end user
Proposed Changes
As requested by @jeremystretch in discussion #18188, I am submitting this housekeeping issue to remove duplicate database indexes.
I started using the feature 'Index Tuning' of the Azure PostgreSQL flexible server for the Netbox database. Netbox version is 3.7.1 and PostgreSQL version is 14.13. After 24 hours, it found 6 rcommendations, all of them to drop duplicate indexes:
Justification
As explained, this is likely because Netbox Team explicitly defines an index for the generic foreign key (GFK) relation termination, which Django does not do automatically. Separately, Netbox Team also declares a uniqueness constraint for this pair of fields, to ensure an object cannot have more than one termination. Hence the duplicate indexes. It should be safe to remove the former index.
The text was updated successfully, but these errors were encountered: