⚡️(admin) optimize recording view by selecting room at the SQL level
Use select_related on the room foreign key to avoid N+1 queries. This makes Django perform a join between tables instead of triggering additional queries per row, reducing complexity from O(n²) patterns to O(n) and significantly improving performance.
This commit is contained in:
committed by
aleb_the_flash
parent
1e1e1a2657
commit
fe28902b2e
@@ -208,6 +208,7 @@ class RecordingAdmin(admin.ModelAdmin):
|
||||
"worker_id",
|
||||
)
|
||||
list_filter = ["created_at"]
|
||||
list_select_related = ("room",)
|
||||
readonly_fields = ["id", "created_at", "updated_at"]
|
||||
actions = [resend_notification]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user