From 3035fbfc3af1ec7a760d3389dcb4fc949c4b6c1b Mon Sep 17 00:00:00 2001 From: Bobbahbrown Date: Tue, 29 Sep 2020 07:07:39 -0300 Subject: [PATCH] SQL Schema Version 5.11 / Add indices for ticket table to support Statbus operations (#53541) * I hope you're proud of yourselves. You've driven away another customer! It's baffling, I tell you! Your deep rooted lack of self-control only fosters failure in every endeavor we undertake! I mean, it's always one step forward and two steps back! Why? Don't you see the example I try to set for you? * thanks jordie --- SQL/database_changelog.txt | 17 ++++++++++++++--- SQL/tgstation_schema.sql | 6 +++++- SQL/tgstation_schema_prefixed.sql | 6 +++++- code/__DEFINES/subsystems.dm | 2 +- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/SQL/database_changelog.txt b/SQL/database_changelog.txt index 27d6cd3190c..a0b087d9355 100644 --- a/SQL/database_changelog.txt +++ b/SQL/database_changelog.txt @@ -1,15 +1,26 @@ Any time you make a change to the schema files, remember to increment the database schema version. Generally increment the minor number, major should be reserved for significant changes to the schema. Both values go up to 255. -The latest database version is 5.10; The query to update the schema revision table is: +The latest database version is 5.11; The query to update the schema revision table is: -INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 10); +INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 11); or -INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 10); +INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 11); In any query remember to add a prefix to the table names if you use one. ----------------------------------------------------- +Version 5.11, 7 September 2020, by bobbahbrown, MrStonedOne, and Jordie0608 + +Adds indices to support search operations on the adminhelp ticket tables. This is to support improved performance on Atlanta Ned's Statbus. + +CREATE INDEX `idx_ticket_act_recip` (`action`, `recipient`) +CREATE INDEX `idx_ticket_act_send` (`action`, `sender`) +CREATE INDEX `idx_ticket_tic_rid` (`ticket`, `round_id`) +CREATE INDEX `idx_ticket_act_time_rid` (`action`, `timestamp`, `round_id`) + +----------------------------------------------------- + Version 5.10, 7 August 2020, by oranges Changes how the discord verification process works. diff --git a/SQL/tgstation_schema.sql b/SQL/tgstation_schema.sql index a01787e395b..64f29f98e2e 100644 --- a/SQL/tgstation_schema.sql +++ b/SQL/tgstation_schema.sql @@ -547,7 +547,11 @@ CREATE TABLE `ticket` ( `timestamp` datetime NOT NULL, `recipient` varchar(32) DEFAULT NULL, `sender` varchar(32) DEFAULT NULL, - PRIMARY KEY (`id`) + PRIMARY KEY (`id`), + KEY `idx_ticket_act_recip` (`action`, `recipient`), + KEY `idx_ticket_act_send` (`action`, `sender`), + KEY `idx_ticket_tic_rid` (`ticket`, `round_id`), + KEY `idx_ticket_act_time_rid` (`action`, `timestamp`, `round_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; DELIMITER $$ diff --git a/SQL/tgstation_schema_prefixed.sql b/SQL/tgstation_schema_prefixed.sql index 03521308c3f..d1f73dd99a0 100644 --- a/SQL/tgstation_schema_prefixed.sql +++ b/SQL/tgstation_schema_prefixed.sql @@ -547,7 +547,11 @@ CREATE TABLE `SS13_ticket` ( `timestamp` datetime NOT NULL, `recipient` varchar(32) DEFAULT NULL, `sender` varchar(32) DEFAULT NULL, - PRIMARY KEY (`id`) + PRIMARY KEY (`id`), + KEY `idx_ticket_act_recip` (`action`, `recipient`), + KEY `idx_ticket_act_send` (`action`, `sender`), + KEY `idx_ticket_tic_rid` (`ticket`, `round_id`), + KEY `idx_ticket_act_time_rid` (`action`, `timestamp`, `round_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; DELIMITER $$ diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index 395169abf0e..d8a1cb313c2 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -20,7 +20,7 @@ * * make sure you add an update to the schema_version stable in the db changelog */ -#define DB_MINOR_VERSION 10 +#define DB_MINOR_VERSION 11 //! ## Timing subsystem