Skip to content

Commit 5049a2c

Browse files
chore: add indexes (#10)
1 parent 0a0ccde commit 5049a2c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

migrations/20250904065521_job_setup.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ CREATE INDEX idx_job_executions_poller_instance
3434
ON job_executions(poller_instance_id)
3535
WHERE state = 'running';
3636

37+
CREATE INDEX idx_job_executions_running_alive_at
38+
ON job_executions(alive_at)
39+
WHERE state = 'running';
40+
41+
CREATE INDEX idx_job_executions_pending_execute_at
42+
ON job_executions(execute_at)
43+
WHERE state = 'pending';
44+
3745
CREATE OR REPLACE FUNCTION notify_job_execution_insert() RETURNS TRIGGER AS $$
3846
BEGIN
3947
PERFORM pg_notify('job_execution', '');

0 commit comments

Comments
 (0)