Skip to content

N+1 issue on the /api/ipam/ip-addresses/ endpoint #15845

Closed
@mulmat

Description

@mulmat

Deployment Type

Self-hosted

NetBox Version

v3.7.6

Python Version

3.10

Steps to Reproduce

Call the /api/ipam/ip-addresses/ endpoint with more than 1 assigned ip address in the database (important that the ip addresses are assigned and you are listing assigned ip addresses, for example by using assigned_to_interface=true filter)

Expected Behavior

No N+1 issue.

I can submit I PR if wanted (I think the issue is that IPAddressViewSet are missing assigned_object_type in the prefetch_related)

Observed Behavior

N+1 issue with the following query:

SELECT ••• FROM "django_content_type" WHERE "django_content_type"."id" = X LIMIT 21

Metadata

Metadata

Assignees

Labels

severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: needs ownerThis issue is tentatively accepted pending a volunteer committed to its implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions