Skip to content

Optimize the assignment of tags when saving an object #21330

@jeremystretch

Description

@jeremystretch

NetBox Version

v4.5.1

Python Version

3.12

Area(s) of Concern

  • User Interface
  • REST API
  • GraphQL API
  • Python ORM
  • Other

Details

Assigning tags to a newly created object is currently done in an inefficient manner. For example, creating a new site with five tags assigned generates ~23 additional SQL queries (4 per tag):

Image

AFAICT these are attributable to the default behavior of the django-taggit manager, but we should explore potential options for optimizing the creation of tag assignments in the database.

Metadata

Metadata

Assignees

No one assigned

    Labels

    netboxstatus: needs triageThis issue is awaiting triage by a maintainertype: performanceA concern regarding application performance

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions