From a47635c4ecf1c40988921e76b81c082d21feccb4 Mon Sep 17 00:00:00 2001 From: Mauro Tschiedel Date: Mon, 13 Feb 2017 00:27:54 -0200 Subject: [PATCH] Changes in database - Increase search speed Is change the database indexes and add a new field to primary key. --- mailalerts.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mailalerts.php b/mailalerts.php index 3b31064..f0e9ed6 100644 --- a/mailalerts.php +++ b/mailalerts.php @@ -108,13 +108,16 @@ public function install($delete_params = true) $sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.MailAlert::$definition['table'].'` ( + `id_mailalert_customer_oos` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_customer` int(10) unsigned NOT NULL, `customer_email` varchar(128) NOT NULL, `id_product` int(10) unsigned NOT NULL, `id_product_attribute` int(10) unsigned NOT NULL, `id_shop` int(10) unsigned NOT NULL, `id_lang` int(10) unsigned NOT NULL, - PRIMARY KEY (`id_customer`,`customer_email`,`id_product`,`id_product_attribute`,`id_shop`) + PRIMARY KEY (`id_mailalert_customer_oos`), + KEY `customer` (`id_customer`,`customer_email`), + KEY `ids` (`id_product`,`id_product_attribute`,`id_shop`) ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci'; if (!Db::getInstance()->execute($sql))