From 61b4afc3c54d7851f8775104ffbe3be332f9a9a9 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Mon, 29 Apr 2019 22:41:24 +0530 Subject: [PATCH] perf: Order by name instead of parent (#17404) Changing the order by column reduced the query time from 60s to 12s --- erpnext/portal/product_configurator/item_variants_cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/portal/product_configurator/item_variants_cache.py b/erpnext/portal/product_configurator/item_variants_cache.py index 458c229e2f9..f17639c1e71 100644 --- a/erpnext/portal/product_configurator/item_variants_cache.py +++ b/erpnext/portal/product_configurator/item_variants_cache.py @@ -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 )