From eb07089088b89ebcf1f95a09aa4a36e7b11927a8 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 21 Feb 2021 16:43:06 +0000 Subject: [PATCH] More missing indexes --- database.sql | 5 ++++- static/dbstructure.config.php | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/database.sql b/database.sql index 602fe08b2d..ca9fc03201 100644 --- a/database.sql +++ b/database.sql @@ -33,7 +33,8 @@ CREATE TABLE IF NOT EXISTS `gserver` ( `next_contact` datetime DEFAULT '0001-01-01 00:00:00' COMMENT 'Next connection request', PRIMARY KEY(`id`), UNIQUE INDEX `nurl` (`nurl`(190)), - INDEX `next_contact` (`next_contact`) + INDEX `next_contact` (`next_contact`), + INDEX `network` (`network`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Global servers'; -- @@ -89,6 +90,7 @@ CREATE TABLE IF NOT EXISTS `user` ( INDEX `nickname` (`nickname`(32)), INDEX `parent-uid` (`parent-uid`), INDEX `guid` (`guid`), + INDEX `email` (`email`(64)), FOREIGN KEY (`parent-uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='The local users'; @@ -193,6 +195,7 @@ CREATE TABLE IF NOT EXISTS `contact` ( INDEX `network_uid_lastupdate` (`network`,`uid`,`last-update`), INDEX `uid_network_self_lastupdate` (`uid`,`network`,`self`,`last-update`), INDEX `uid_lastitem` (`uid`,`last-item`), + INDEX `baseurl` (`baseurl`(64)), INDEX `gsid` (`gsid`), FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE, FOREIGN KEY (`gsid`) REFERENCES `gserver` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 2185ce3c3b..79c4fb62b9 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -91,6 +91,7 @@ return [ "PRIMARY" => ["id"], "nurl" => ["UNIQUE", "nurl(190)"], "next_contact" => ["next_contact"], + "network" => ["network"], ] ], "user" => [ @@ -253,6 +254,7 @@ return [ "network_uid_lastupdate" => ["network", "uid", "last-update"], "uid_network_self_lastupdate" => ["uid", "network", "self", "last-update"], "uid_lastitem" => ["uid", "last-item"], + "baseurl" => ["baseurl(64)"], "gsid" => ["gsid"] ] ],