mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-07-29 23:34:56 +00:00
Perf: select_related/prefetch_related for the scoped LLM index batch
This commit is contained in:
committed by
Trenton H
parent
8fa5f65708
commit
b62bb8a062
@@ -389,6 +389,8 @@ def update_llm_index(
|
||||
else:
|
||||
scoped_documents = (
|
||||
Document.objects.filter(id__in=document_ids)
|
||||
.select_related("correspondent", "document_type", "storage_path")
|
||||
.prefetch_related("tags")
|
||||
if document_ids is not None
|
||||
else documents
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user