diff --git a/code/common/db/src/main/resources/sql/current/12-message-queue.sql b/code/common/db/src/main/resources/sql/current/12-message-queue.sql index 25bdc636..6e628e80 100644 --- a/code/common/db/src/main/resources/sql/current/12-message-queue.sql +++ b/code/common/db/src/main/resources/sql/current/12-message-queue.sql @@ -16,3 +16,6 @@ CREATE TABLE IF NOT EXISTS MESSAGE_QUEUE ( UPDATED_TIME TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT 'Time of last update', TTL INT COMMENT 'Time to live in seconds' ); + +CREATE INDEX MESSAGE_QUEUE_STATE_IDX ON MESSAGE_QUEUE(STATE); +CREATE INDEX MESSAGE_QUEUE_OI_TICK_IDX ON MESSAGE_QUEUE(OWNER_INSTANCE, OWNER_TICK); diff --git a/code/common/db/src/main/resources/sql/migrations/04-message-queue.sql b/code/common/db/src/main/resources/sql/migrations/04-message-queue.sql index 25bdc636..6e628e80 100644 --- a/code/common/db/src/main/resources/sql/migrations/04-message-queue.sql +++ b/code/common/db/src/main/resources/sql/migrations/04-message-queue.sql @@ -16,3 +16,6 @@ CREATE TABLE IF NOT EXISTS MESSAGE_QUEUE ( UPDATED_TIME TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT 'Time of last update', TTL INT COMMENT 'Time to live in seconds' ); + +CREATE INDEX MESSAGE_QUEUE_STATE_IDX ON MESSAGE_QUEUE(STATE); +CREATE INDEX MESSAGE_QUEUE_OI_TICK_IDX ON MESSAGE_QUEUE(OWNER_INSTANCE, OWNER_TICK);