mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-08-26 20:53:20 +00:00
Performance: fetch note authors with prefetch instead of one query each (#13790)
This commit is contained in:
@@ -1133,7 +1133,8 @@ class DocumentViewSet(
|
||||
"custom_fields",
|
||||
queryset=CustomFieldInstance.objects.select_related("field"),
|
||||
),
|
||||
"notes",
|
||||
# NotesSerializer nests the author, this avoids query per note
|
||||
Prefetch("notes", queryset=Note.objects.select_related("user")),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user