Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes: #18606 UI Racks Table View Performance Scaling Problem - Loading time increases with large number of racks - django N+1 query issue #18801

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renatoalmeidaoliveira
Copy link
Collaborator

Fixes: #18606 UI Racks Table View Performance Scaling Problem - Loading time increases with large number of racks - django N+1 query issue

  • The issue happens with the collumns: get_utilization and get_power_utilization
  • Both collumns are calculated inside the model
  • Adding a prefetch for reservations inside the RackListView queryset partially fixes the problem reduncing the amount of queries from 123 to 85 using NetBox sample data with 42 rack models

Investigating the get_utilization method of the Rack model and comparing with the executed queries in the List view it seens the N+1 queries happens from this line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant