Skip to content

N+1 problem in dcim/ipam API calls #19309

Closed
@Tishka17

Description

@Tishka17

Deployment Type

Self-hosted

NetBox Version

v4.2.8

Python Version

3.10

Steps to Reproduce

  1. Enable SQL logging
  2. Do API requests:
  • api/ipam/ip-addresses/
  • api/ipam/prefixes
  • api/dcim/interfaces

Expected Behavior

All required data is loaded by batch SQL requests

Observed Behavior

In the output you will see repeated SQL calls for each object in the response set:

  • circuits_virtualcircuittermination for interfaces
  • dcim_interface folowing by dcim_device for ip-address
  • dcim_site for prefixes

Metadata

Metadata

Assignees

Labels

severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions