hub: fix index so it gets used by planner

Fixes: https://pagure.io/koji/issue/2333
This commit is contained in:
Tomas Kopecek 2020-06-24 10:16:35 +02:00
parent 241bb6f1b6
commit 6d41344d38
2 changed files with 4 additions and 1 deletions

View file

@ -126,7 +126,7 @@ CREATE TABLE sessions (
UNIQUE (user_id,exclusive)
) WITHOUT OIDS;
CREATE INDEX sessions_master ON sessions(master);
CREATE INDEX sessions_active_and_recent ON sessions(expired, master, update_time) WHERE (expired IS NOT TRUE AND master IS NULL);
CREATE INDEX sessions_active_and_recent ON sessions(expired, master, update_time) WHERE (expired = FALSE AND master IS NULL);
CREATE INDEX sessions_expired ON sessions(expired);
-- Channels are used to limit which tasks are run on which machines.