hub: fix index so it gets used by planner
Fixes: https://pagure.io/koji/issue/2333
This commit is contained in:
parent
241bb6f1b6
commit
6d41344d38
2 changed files with 4 additions and 1 deletions
|
|
@ -28,4 +28,7 @@ CREATE FUNCTION get_event_time(INTEGER) RETURNS TIMESTAMPTZ AS '
|
|||
SELECT time FROM events WHERE id=$1;
|
||||
' LANGUAGE SQL;
|
||||
|
||||
DROP INDEX IF EXISTS sessions_active_and_recent;
|
||||
CREATE INDEX sessions_active_and_recent ON sessions(expired, master, update_time) WHERE (expired = FALSE AND master IS NULL);
|
||||
|
||||
COMMIT;
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue