From 3c10f6ef863f0eac713de0869c753cee5b607dae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Baptiste=20Onofr=C3=A9?= Date: Tue, 19 Nov 2019 05:45:30 +0100 Subject: [PATCH] [AMQ-7008] Add index on messages table to speed up browsing --- .../main/java/org/apache/activemq/store/jdbc/Statements.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/Statements.java b/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/Statements.java index 0fe63386e3..b6797123b9 100644 --- a/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/Statements.java +++ b/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/Statements.java @@ -115,7 +115,8 @@ public class Statements { "ALTER TABLE " + getFullAckTableName() + " " + getDropAckPKAlterStatementEnd(), "ALTER TABLE " + getFullAckTableName() + " ADD PRIMARY KEY (CONTAINER, CLIENT_ID, SUB_NAME, PRIORITY)", "CREATE INDEX " + getFullMessageTableName() + "_XIDX ON " + getFullMessageTableName() + " (XID)", - "CREATE INDEX " + getFullAckTableName() + "_XIDX ON " + getFullAckTableName() + " (XID)" + "CREATE INDEX " + getFullAckTableName() + "_XIDX ON " + getFullAckTableName() + " (XID)", + "CREATE INDEX " + getFullMessageTableName() + "_IIDX ON " + getFullMessageTableName() + " (ID ASC, XID, CONTAINER)" }; } getCreateLockSchemaStatements();