Index threads.forum_id and comments.thread_id
This commit is contained in:
@@ -39,3 +39,8 @@ create table forums (
|
|||||||
description text,
|
description text,
|
||||||
allowed_roles_mask integer not null
|
allowed_roles_mask integer not null
|
||||||
);
|
);
|
||||||
|
|
||||||
|
-- Both of these speed up searches significantly if there are many threads or comments.
|
||||||
|
-- Other indices have no measureable impact (yet, at least).
|
||||||
|
create index forum_id on threads(forum_id);
|
||||||
|
create index thread_id on comments(thread_id);
|
||||||
|
|||||||
Reference in New Issue
Block a user