From 13309770133be39361a77046dabdd5e235947e66 Mon Sep 17 00:00:00 2001 From: rkrahnen Date: Tue, 9 Oct 2018 10:05:06 +0200 Subject: [PATCH] added index on state and scheduled improve performance for large queues --- Classes/Queue/DoctrineQueue.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Classes/Queue/DoctrineQueue.php b/Classes/Queue/DoctrineQueue.php index 3de42c5..d89558c 100644 --- a/Classes/Queue/DoctrineQueue.php +++ b/Classes/Queue/DoctrineQueue.php @@ -116,6 +116,7 @@ public function setUp(): void $createDatabaseStatement = "CREATE TABLE IF NOT EXISTS {$this->connection->quoteIdentifier($this->tableName)} (id INTEGER PRIMARY KEY AUTO_INCREMENT, payload LONGTEXT NOT NULL, state VARCHAR(255) NOT NULL, failures INTEGER NOT NULL DEFAULT 0, scheduled DATETIME DEFAULT NULL) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB"; } $this->connection->exec($createDatabaseStatement); + $this->connection->exec("CREATE INDEX state_scheduled ON {$this->connection->quoteIdentifier($this->tableName)} (state, scheduled)"); } /**