mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-18 05:48:13 +00:00
Handcrafts SQL queries a little more to reduce the query count and/or the amount of returned data (#6489)
This commit is contained in:
1 parent
63e1f9f5d3
commit
7be7185418
10 files changed
+188
-135
No files matched your search
@@ -155,8 +155,12 @@ class DocumentClassifier:
|
||||
|
||||
def train(self):
|
||||
# Get non-inbox documents
|
||||
docs_queryset = Document.objects.exclude(
|
||||
tags__is_inbox_tag=True,
|
||||
docs_queryset = (
|
||||
Document.objects.exclude(
|
||||
tags__is_inbox_tag=True,
|
||||
)
|
||||
.select_related("document_type", "correspondent", "storage_path")
|
||||
.prefetch_related("tags")
|
||||
)
|
||||
|
||||
# No documents exit to train against
|
||||
|
||||
Reference in new issue
Block a user