mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-10 00:18:41 +00:00
Performance: stop embedding every document ID in selection_data queries (#14597)
* Fix: count selection_data from one pass over the filtered documents Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Chore: use document type ids in the bulk edit selection_data test Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Batch search selection data queries Co-Authored-By: Codex <267193182+codex@users.noreply.github.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com> Co-authored-by: Codex <267193182+codex@users.noreply.github.com>
This commit is contained in:
5 files changed
+212
-105
No files matched your search
@@ -576,12 +576,9 @@ def annotate_document_count_by_ids(
|
||||
or CustomFieldInstance)
|
||||
related_object_field: field on the relation pointing back to queryset pk
|
||||
document_ids: the document ids to count against -- a concrete list/set,
|
||||
or a simple (already resolved) queryset of ids. Callers
|
||||
that need this filtered by a complex condition (e.g. a
|
||||
permission check) should resolve it to a concrete list
|
||||
first if the same ids will be reused across multiple
|
||||
calls, rather than passing the complex queryset itself
|
||||
into each -- see ``_get_selection_data_for_queryset``.
|
||||
or a simple (already resolved) queryset of ids. Keep
|
||||
the list small: it is embedded in the statement as
|
||||
literal parameters.
|
||||
target_field: field on the relation pointing to Document id
|
||||
"""
|
||||
|
||||
|
||||
Reference in new issue
Block a user