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

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

Copy link
Contributor

github-actions bot commented Apr 4, 2025

This PR has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further action is taken.

@github-actions github-actions bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Apr 4, 2025
@jeremystretch jeremystretch removed the pending closure Requires immediate attention to avoid being closed for inactivity label Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants