From 45f79ef6444b9ae99603fa4b5a731a80a4e69636 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 13:02:08 +0530 Subject: [PATCH] perf: add indexes on payment entry reference (backport #33288) (#33290) perf: add indexes on payment entry reference (#33288) Adds index on: 1. reference doctype 2. reference name *Why not composite index?* There are three type of queries on this doctype - filtering ref_doctype - doctype index helps here - filtering ref_name - name index helps here - filtering both - name index helps here too. Since it has sufficiently high cardinality. Composite index wont help in case where ref_doctype isn't specfied. [skip ci] (cherry picked from commit 593626f5022bd5af1241e8c5ecb807c04943bd42) Co-authored-by: Ankush Menat --- .../payment_entry_reference/payment_entry_reference.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json b/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json index 8961167f018..3003c68196e 100644 --- a/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json +++ b/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json @@ -25,7 +25,8 @@ "in_list_view": 1, "label": "Type", "options": "DocType", - "reqd": 1 + "reqd": 1, + "search_index": 1 }, { "columns": 2, @@ -35,7 +36,8 @@ "in_list_view": 1, "label": "Name", "options": "reference_doctype", - "reqd": 1 + "reqd": 1, + "search_index": 1 }, { "fieldname": "due_date", @@ -104,7 +106,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2021-09-26 17:06:55.597389", + "modified": "2022-12-12 12:31:44.919895", "modified_by": "Administrator", "module": "Accounts", "name": "Payment Entry Reference", @@ -113,5 +115,6 @@ "quick_entry": 1, "sort_field": "modified", "sort_order": "DESC", + "states": [], "track_changes": 1 } \ No newline at end of file