perf: Order by name instead of parent (#17404)

Changing the order by column reduced the query time from 60s to 12s
This commit is contained in:
Faris Ansari 2019-04-29 22:41:24 +05:30 committed by GitHub
parent 9f660267c1
commit 61b4afc3c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,7 +62,7 @@ class ItemVariantsCacheManager:
item_variants_data = frappe.db.get_all('Item Variant Attribute',
{'variant_of': parent_item_code}, ['parent', 'attribute', 'attribute_value'],
order_by='parent',
order_by='name',
as_list=1
)