From dad5df0059ff2870901eadf06e9486e6fa80b7f5 Mon Sep 17 00:00:00 2001 From: Mike Colagrosso Date: Tue, 31 Dec 2024 21:12:56 -0700 Subject: [PATCH] Add index on EbookId There are several queries that join the `Projects` and `Ebooks` tables. An index speeds up those joins. --- config/sql/se/Projects.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/sql/se/Projects.sql b/config/sql/se/Projects.sql index 9507eff6..9fc157d2 100644 --- a/config/sql/se/Projects.sql +++ b/config/sql/se/Projects.sql @@ -15,5 +15,6 @@ CREATE TABLE IF NOT EXISTS `Projects` ( `LastCommitTimestamp` DATETIME NULL DEFAULT NULL, `LastDiscussionTimestamp` DATETIME NULL DEFAULT NULL, `IsStatusAutomaticallyUpdated` tinyint(1) NOT NULL DEFAULT 1, - PRIMARY KEY (`ProjectId`) + PRIMARY KEY (`ProjectId`), + KEY `index1` (`EbookId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;