Closed
Description
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