Implement a mechanism for maintaining denormalized (cached) database fields #6760

Closed
opened 2025-12-29 19:45:08 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Aug 2, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.3-beta1

Feature type

New functionality

Proposed functionality

Establish a mechanism for registry denormalized model fields within the application so that they can be kept up-to-date. (These are fields which store cached values from elsewhere in the database.) The registry can be used to track these fields, and we can leverage Django signals to trigger automatic updates in the event of a change.

#9902 could also help with this effort, although I don't believe it's strictly required.

Use case

Sometimes it is necessary to denormalize certain database fields for performance optimization and/or to enable filtering. For example, the CableTermination model introduced in v3.3 caches the device, rack, location, and site associated with its termination object.

Database changes

This feature should not require any database changes itself.

External dependencies

No response

Originally created by @jeremystretch on GitHub (Aug 2, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.3-beta1 ### Feature type New functionality ### Proposed functionality Establish a mechanism for registry denormalized model fields within the application so that they can be kept up-to-date. (These are fields which store cached values from elsewhere in the database.) The registry can be used to track these fields, and we can leverage Django signals to trigger automatic updates in the event of a change. #9902 could also help with this effort, although I don't believe it's strictly required. ### Use case Sometimes it is necessary to denormalize certain database fields for performance optimization and/or to enable filtering. For example, the CableTermination model introduced in v3.3 caches the device, rack, location, and site associated with its termination object. ### Database changes This feature should not require any database changes itself. ### External dependencies _No response_
adam added the status: acceptedtype: featurebeta labels 2025-12-29 19:45:08 +01:00
adam closed this issue 2025-12-29 19:45:08 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6760