Skip to content

Commit c6ea78b

Browse files
committed
Fix MySQL index
1 parent 61d80aa commit c6ea78b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

backend/mysql/schema.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS `instances` (
1111
`worker` NVARCHAR(64) NULL,
1212

1313
UNIQUE INDEX `idx_instances_instance_id` (`instance_id`),
14-
INDEX `idx_instances_locked_until_completed_at` (`locked_until`, `sticky_until`, `completed_at`, `worker`),
14+
INDEX `idx_instances_locked_until_completed_at` (`completed_at`, `locked_until`, `sticky_until`, `worker`),
1515
INDEX `idx_instances_parent_instance_id` (`parent_instance_id`)
1616
);
1717

@@ -26,7 +26,8 @@ CREATE TABLE IF NOT EXISTS `pending_events` (
2626
`attributes` BLOB NOT NULL,
2727
`visible_at` DATETIME NULL,
2828

29-
INDEX `idx_pending_events_instance_id` (`instance_id`)
29+
INDEX `idx_pending_events_instance_id` (`instance_id`),
30+
INDEX `idx_instance_id_visible_at` (`instance_id`, `visible_at`)
3031
);
3132

3233

0 commit comments

Comments
 (0)