This is an automated email from the ASF dual-hosted git repository.
rcordier pushed a commit to branch postgresql
in repository https://gitbox.apache.org/repos/asf/james-project.git
The following commit(s) were added to refs/heads/postgresql by this push:
new 194832f1ba JAMES-2586 Add index for thread table
194832f1ba is described below
commit 194832f1ba30df2ef260e7f64c9b4fc020709fea
Author: TungTV <[email protected]>
AuthorDate: Thu Nov 28 10:53:57 2024 +0700
JAMES-2586 Add index for thread table
---
.../james/mailbox/postgres/mail/dao/PostgresThreadModule.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git
a/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/dao/PostgresThreadModule.java
b/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/dao/PostgresThreadModule.java
index 046db43c82..b37afd9352 100644
---
a/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/dao/PostgresThreadModule.java
+++
b/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/dao/PostgresThreadModule.java
@@ -19,6 +19,7 @@
package org.apache.james.mailbox.postgres.mail.dao;
+import static
org.apache.james.mailbox.postgres.mail.dao.PostgresThreadModule.PostgresThreadTable.HASH_MIME_MESSAGE_ID_INDEX;
import static
org.apache.james.mailbox.postgres.mail.dao.PostgresThreadModule.PostgresThreadTable.MESSAGE_ID_INDEX;
import static
org.apache.james.mailbox.postgres.mail.dao.PostgresThreadModule.PostgresThreadTable.TABLE;
import static
org.apache.james.mailbox.postgres.mail.dao.PostgresThreadModule.PostgresThreadTable.THREAD_ID_INDEX;
@@ -62,11 +63,16 @@ public interface PostgresThreadModule {
PostgresIndex THREAD_ID_INDEX =
PostgresIndex.name("thread_thread_id_index")
.createIndexStep((dsl, indexName) ->
dsl.createIndexIfNotExists(indexName)
.on(TABLE_NAME, USERNAME, THREAD_ID));
+
+ PostgresIndex HASH_MIME_MESSAGE_ID_INDEX =
PostgresIndex.name("thread_has_mime_message_id_index")
+ .createIndexStep((dsl, indexName) ->
dsl.createIndexIfNotExists(indexName)
+ .on(TABLE_NAME, USERNAME, HASH_MIME_MESSAGE_ID));
}
PostgresModule MODULE = PostgresModule.builder()
.addTable(TABLE)
.addIndex(MESSAGE_ID_INDEX)
.addIndex(THREAD_ID_INDEX)
+ .addIndex(HASH_MIME_MESSAGE_ID_INDEX)
.build();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]