From be2a69861880be48564bd4eaf8f257fc06d24947 Mon Sep 17 00:00:00 2001 From: Alex Vester Date: Mon, 15 Mar 2021 12:20:22 -0500 Subject: [PATCH] GH-3512: NULLS LAST for PostgreSQL priority index Fixes https://github.com/spring-projects/spring-integration/issues/3512 See https://use-the-index-luke.com/sql/sorting-grouping/order-by-asc-desc-nulls-last for more info --- .../org/springframework/integration/jdbc/schema-postgresql.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-postgresql.sql b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-postgresql.sql index 8d09838086..5b50bf867e 100644 --- a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-postgresql.sql +++ b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-postgresql.sql @@ -49,7 +49,7 @@ CREATE TABLE INT_CHANNEL_MESSAGE ( CREATE INDEX INT_CHANNEL_MSG_DELETE_IDX ON INT_CHANNEL_MESSAGE (REGION, GROUP_KEY, MESSAGE_ID); -- This is only needed if the message group store property 'priorityEnabled' is true --- CREATE UNIQUE INDEX INT_CHANNEL_MSG_PRIORITY_IDX ON INT_CHANNEL_MESSAGE (REGION, GROUP_KEY, MESSAGE_PRIORITY DESC, CREATED_DATE, MESSAGE_SEQUENCE); +-- CREATE UNIQUE INDEX INT_CHANNEL_MSG_PRIORITY_IDX ON INT_CHANNEL_MESSAGE (REGION, GROUP_KEY, MESSAGE_PRIORITY DESC NULLS LAST, CREATED_DATE, MESSAGE_SEQUENCE); CREATE TABLE INT_METADATA_STORE (