From 5d02a20719eaf046927aaf2b1fc61a377a77c652 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Fri, 7 Nov 2025 20:30:59 +0100 Subject: [PATCH] SQL/Misc * add keys to spells table to speed up related spells queries --- setup/sql/01-db_structure.sql | 19 ++++++++++++++++++- setup/sql/02-db_initial_data.sql | 2 +- setup/sql/updates/1762543652_01.sql | 18 ++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 setup/sql/updates/1762543652_01.sql diff --git a/setup/sql/01-db_structure.sql b/setup/sql/01-db_structure.sql index d276bdfd..3434c71c 100644 --- a/setup/sql/01-db_structure.sql +++ b/setup/sql/01-db_structure.sql @@ -2737,7 +2737,24 @@ CREATE TABLE `aowow_spell` ( KEY `spell` (`id`) USING BTREE, KEY `effects` (`effect1Id`,`effect2Id`,`effect3Id`), KEY `items` (`effect1CreateItemId`,`effect2CreateItemId`,`effect3CreateItemId`), - KEY `iconId` (`iconId`) + KEY `iconId` (`iconId`), + KEY `reagent1` (`reagent1`), + KEY `reagent2` (`reagent2`), + KEY `reagent3` (`reagent3`), + KEY `reagent4` (`reagent4`), + KEY `reagent5` (`reagent5`), + KEY `reagent6` (`reagent6`), + KEY `reagent7` (`reagent7`), + KEY `reagent8` (`reagent8`), + KEY `effect1CreateItemId` (`effect1CreateItemId`), + KEY `effect2CreateItemId` (`effect2CreateItemId`), + KEY `effect3CreateItemId` (`effect3CreateItemId`), + KEY `effect1Id` (`effect1Id`), + KEY `effect2Id` (`effect2Id`), + KEY `effect3Id` (`effect3Id`), + KEY `effect1AuraId` (`effect1AuraId`), + KEY `effect2AuraId` (`effect2AuraId`), + KEY `effect3AuraId` (`effect3AuraId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/setup/sql/02-db_initial_data.sql b/setup/sql/02-db_initial_data.sql index f895ef4c..df0fbe49 100644 --- a/setup/sql/02-db_initial_data.sql +++ b/setup/sql/02-db_initial_data.sql @@ -71,7 +71,7 @@ UNLOCK TABLES; LOCK TABLES `aowow_dbversion` WRITE; /*!40000 ALTER TABLE `aowow_dbversion` DISABLE KEYS */; -INSERT INTO `aowow_dbversion` VALUES (1762352734,0,NULL,NULL); +INSERT INTO `aowow_dbversion` VALUES (1762543653,0,NULL,NULL); /*!40000 ALTER TABLE `aowow_dbversion` ENABLE KEYS */; UNLOCK TABLES; diff --git a/setup/sql/updates/1762543652_01.sql b/setup/sql/updates/1762543652_01.sql new file mode 100644 index 00000000..2e3027b3 --- /dev/null +++ b/setup/sql/updates/1762543652_01.sql @@ -0,0 +1,18 @@ +ALTER TABLE `aowow_spell` + ADD KEY reagent1 (`reagent1`), + ADD KEY reagent2 (`reagent2`), + ADD KEY reagent3 (`reagent3`), + ADD KEY reagent4 (`reagent4`), + ADD KEY reagent5 (`reagent5`), + ADD KEY reagent6 (`reagent6`), + ADD KEY reagent7 (`reagent7`), + ADD KEY reagent8 (`reagent8`), + ADD KEY effect1CreateItemId (`effect1CreateItemId`), + ADD KEY effect2CreateItemId (`effect2CreateItemId`), + ADD KEY effect3CreateItemId (`effect3CreateItemId`), + ADD KEY effect1Id (`effect1Id`), + ADD KEY effect2Id (`effect2Id`), + ADD KEY effect3Id (`effect3Id`), + ADD KEY effect1AuraId (`effect1AuraId`), + ADD KEY effect2AuraId (`effect2AuraId`), + ADD KEY effect3AuraId (`effect3AuraId`);