-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Plugin Version
0.4.1
NetBox Version
4.4.5
Python Version
3.12.3
Steps to Reproduce
- Create a cot
- Create a cf > Multiple objects > DCIM Interface
- Create 30k instances of cot
- Enter to any interface (https://localhost/dcim/interfaces/120/) takes ~25 seconds
Expected Behavior
Perform only one query to see if any cot instance is related to the interface.
Observed Behavior
Netbox perform one query per instance, if you have 30k instances, netbox performs 30k queries.
LOG: duration: 0.257 ms statement: SELECT 1 AS "a" FROM "dcim_interface" WHERE ("dcim_interface"."id" IN (SELECT U0."target_id" AS "target_id" FROM "custom_objects_1_interfaces" U0 WHERE U0."source_id" = 1603) AND "dcim_interface"."id" = 641714) LIMIT 1
if the average duration is 0.25 ms it takes ~7.5 seconds querying, plus latency to the server.