From 0241b0d4ee92c9902333c09f820f701da76d5482 Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Sun, 10 Mar 2019 03:05:15 +0100 Subject: [PATCH 1/3] Missing index to improve the performance of product/variants display https://github.com/Dolibarr/dolibarr/issues/10787 --- htdocs/install/mysql/migration/9.0.0-10.0.0.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index f877c193750..c1ba9fbe81f 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -242,3 +242,5 @@ ALTER TABLE llx_facturedet_rec ADD COLUMN fk_user_modif integer; ALTER TABLE llx_expensereport_det MODIFY COLUMN value_unit double(24,8) NOT NULL; ALTER TABLE llx_expensereport_det ADD COLUMN subprice double(24,8) DEFAULT 0 NOT NULL after qty; +ALTER TABLE `llx_product_attribute_combination` ADD INDEX(` fk_product_parent `); +ALTER TABLE `llx_product_attribute_combination` ADD INDEX(` fk_product_child `); From fa3246e70baefb8bd1662d701c79681df9cda366 Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Sun, 10 Mar 2019 03:09:23 +0100 Subject: [PATCH 2/3] Missing index to improve the performance of product/variants display --- htdocs/install/mysql/migration/9.0.0-10.0.0.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index c1ba9fbe81f..28312f64f18 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -242,5 +242,5 @@ ALTER TABLE llx_facturedet_rec ADD COLUMN fk_user_modif integer; ALTER TABLE llx_expensereport_det MODIFY COLUMN value_unit double(24,8) NOT NULL; ALTER TABLE llx_expensereport_det ADD COLUMN subprice double(24,8) DEFAULT 0 NOT NULL after qty; -ALTER TABLE `llx_product_attribute_combination` ADD INDEX(` fk_product_parent `); -ALTER TABLE `llx_product_attribute_combination` ADD INDEX(` fk_product_child `); +ALTER TABLE llx_product_attribute_combination ADD INDEX( fk_product_parent ); +ALTER TABLE llx_product_attribute_combination ADD INDEX( fk_product_child ); From def8e770cab007f746bd6b83e58eba19adaa574a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Mar 2019 17:47:19 +0100 Subject: [PATCH 3/3] Fix name of indexes --- htdocs/install/mysql/migration/9.0.0-10.0.0.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index 28312f64f18..4b6a511d0e5 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -242,5 +242,6 @@ ALTER TABLE llx_facturedet_rec ADD COLUMN fk_user_modif integer; ALTER TABLE llx_expensereport_det MODIFY COLUMN value_unit double(24,8) NOT NULL; ALTER TABLE llx_expensereport_det ADD COLUMN subprice double(24,8) DEFAULT 0 NOT NULL after qty; -ALTER TABLE llx_product_attribute_combination ADD INDEX( fk_product_parent ); -ALTER TABLE llx_product_attribute_combination ADD INDEX( fk_product_child ); +ALTER TABLE llx_product_attribute_combination ADD INDEX idx_product_att_com_product_parent (fk_product_parent); +ALTER TABLE llx_product_attribute_combination ADD INDEX idx_product_att_com_product_child (fk_product_child); +