From bad50d31c09fc04e978f1de78756d22b60711ee9 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 5 Jan 2020 12:48:18 +0000 Subject: [PATCH] Added index for performance considerations --- database.sql | 3 ++- static/dbstructure.config.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/database.sql b/database.sql index 02d1ac895c..6252f80579 100644 --- a/database.sql +++ b/database.sql @@ -1287,7 +1287,8 @@ CREATE TABLE IF NOT EXISTS `user-item` ( `pinned` boolean COMMENT 'The item is pinned on the profile page', `notification-type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '', PRIMARY KEY(`uid`,`iid`), - INDEX `uid_pinned` (`uid`,`pinned`) + INDEX `uid_pinned` (`uid`,`pinned`), + INDEX `iid_uid` (`iid`,`uid`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='User specific item data'; -- diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index a7d851943d..20bd937690 100755 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -1393,7 +1393,8 @@ return [ ], "indexes" => [ "PRIMARY" => ["uid", "iid"], - "uid_pinned" => ["uid", "pinned"] + "uid_pinned" => ["uid", "pinned"], + "iid_uid" => ["iid", "uid"] ] ], "worker-ipc" => [