From 5567bcd85db77b30d3310a103e03608fa0d8bcb3 Mon Sep 17 00:00:00 2001 From: Martin Ambrus Date: Mon, 23 Oct 2017 17:50:33 +0200 Subject: [PATCH] refactor: DB optimizations --- install/data/sql.sql | 3 ++- sql_updates.txt | 4 ++++ todo.txt | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/install/data/sql.sql b/install/data/sql.sql index 27a4e1b0..d67b0fa6 100644 --- a/install/data/sql.sql +++ b/install/data/sql.sql @@ -1032,7 +1032,8 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%medal` ( `points` varchar(15) NULL, `img` varchar(10) NULL, `del` tinyint(1) NULL DEFAULT '0', - PRIMARY KEY (`id`) + PRIMARY KEY (`id`), + KEY `week` (`week`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- diff --git a/sql_updates.txt b/sql_updates.txt index c94d833b..4122d6cf 100644 --- a/sql_updates.txt +++ b/sql_updates.txt @@ -1,3 +1,7 @@ +-- 23.10.2017 -> SQL optimizations +ALTER TABLE `s1_medal` ADD INDEX(`week`); + + -- 22.10.2017 -> SQL optimizations ALTER TABLE `s1_users` ADD INDEX(`tribe`); ALTER TABLE `s1_users` ADD INDEX `timestamp-tribe` (`timestamp`, `tribe`); diff --git a/todo.txt b/todo.txt index e6fa78dc..9b42e6eb 100644 --- a/todo.txt +++ b/todo.txt @@ -10,5 +10,6 @@ "SELECT * FROM s1_vdata WHERE wood > maxstore OR clay > maxstore OR iron > maxstore OR crop > maxcrop" "SELECT * FROM s1_odata WHERE maxstore < 800 OR maxcrop < 800" "SELECT * FROM s1_vdata WHERE wood < 0 OR clay < 0 OR iron < 0 OR crop < 0" + "SELECT * FROM `s1_fdata`" - try to find and fix this (it's probably automation but has came up with a new registration, first login): "UPDATE s1_units set hero = hero - WHERE vref = 38801" \ No newline at end of file