perf: Avoid ordering in count query (#25451)

Order doesn't matter for count. This PR now actually makes https://github.com/frappe/frappe/pull/25348 effective
This commit is contained in:
Ankush Menat 2024-03-14 20:33:27 +05:30 committed by GitHub
parent 8e3175f3e8
commit dbe55d4ace
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -58,6 +58,7 @@ def get_count() -> int:
distinct = "distinct " if args.distinct else ""
args.limit = cint(args.limit)
fieldname = f"{distinct}`tab{args.doctype}`.name"
args.order_by = None
if args.limit:
args.fields = [fieldname]