From 7b8e1d56c288b22cfd7953de73cf0ca7e5f9ed88 Mon Sep 17 00:00:00 2001 From: Roman Samarsky Date: Mon, 22 Oct 2018 15:20:10 +0300 Subject: [PATCH] Added index for queue field in the enqueue collection --- pkg/mongodb/MongodbContext.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/mongodb/MongodbContext.php b/pkg/mongodb/MongodbContext.php index 968c98b1e..e6f5a579c 100644 --- a/pkg/mongodb/MongodbContext.php +++ b/pkg/mongodb/MongodbContext.php @@ -158,6 +158,7 @@ public function getConfig(): array public function createCollection(): void { $collection = $this->getCollection(); + $collection->createIndex(['queue' => 1], ['name' => 'enqueue_queue']); $collection->createIndex(['priority' => -1, 'published_at' => 1], ['name' => 'enqueue_priority']); $collection->createIndex(['delayed_until' => 1], ['name' => 'enqueue_delayed']); }