use better index for sessions

Fixes: https://pagure.io/koji/issue/1372
This commit is contained in:
Tomas Kopecek 2019-06-04 14:00:00 +02:00 committed by Mike McLean
parent dcc23dcfcf
commit 03bf5554c5
2 changed files with 3 additions and 0 deletions

View file

@ -118,6 +118,7 @@ CREATE TABLE sessions (
) 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_expired ON sessions(expired);
-- Channels are used to limit which tasks are run on which machines.
-- Each task is assigned to a channel and each host 'listens' on one