Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3515314
D8512.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D8512.diff
View Options
diff --git a/keyserver/src/database/migration-config.js b/keyserver/src/database/migration-config.js
--- a/keyserver/src/database/migration-config.js
+++ b/keyserver/src/database/migration-config.js
@@ -479,6 +479,17 @@
`,
),
],
+ [
+ 41,
+ () =>
+ dbQuery(
+ SQL`
+ ALTER TABLE memberships
+ DROP INDEX user,
+ ADD KEY user_role_thread (user, role, thread)
+ `,
+ ),
+ ],
]);
const newDatabaseVersion: number = Math.max(...migrations.keys());
diff --git a/keyserver/src/database/setup-db.js b/keyserver/src/database/setup-db.js
--- a/keyserver/src/database/setup-db.js
+++ b/keyserver/src/database/setup-db.js
@@ -308,10 +308,9 @@
ADD PRIMARY KEY (id);
ALTER TABLE memberships
- ADD UNIQUE KEY thread_user (thread,user) USING BTREE,
- ADD KEY role (role) USING BTREE;
-
- ALTER TABLE memberships ADD INDEX user (user);
+ ADD UNIQUE KEY thread_user (thread, user) USING BTREE,
+ ADD KEY role (role) USING BTREE,
+ ADD KEY user_role_thread (user, role, thread);
ALTER TABLE messages
ADD PRIMARY KEY (id),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 8:26 AM (15 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2694134
Default Alt Text
D8512.diff (1 KB)
Attached To
Mode
D8512: [keyserver] Introduce index to optimize new fetchThreadInfos query
Attached
Detach File
Event Timeline
Log In to Comment