Performance: fetch note authors with prefetch instead of one query each (#13790)

This commit is contained in:
shamoon
2026-08-25 14:35:22 -07:00
committed by GitHub
parent e24db7023a
commit 78025df405
+2 -1
View File
@@ -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")),
)
)