More missing indexes

This commit is contained in:
Michael 2021-02-21 16:43:06 +00:00
parent dacf36d05a
commit eb07089088
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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"]
]
],