Skip to content

Commit f8283fa

Browse files
committed
GH-519 - Improve Postgres default indexes.
We now use a hash index for the serialized event to improve performance.
1 parent 919d565 commit f8283fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-modulith-events/spring-modulith-events-jdbc/src/main/resources/schema-postgresql.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ CREATE TABLE IF NOT EXISTS event_publication
88
completion_date TIMESTAMP WITH TIME ZONE,
99
PRIMARY KEY (id)
1010
);
11-
CREATE INDEX IF NOT EXISTS event_publication_by_listener_id_and_serialized_event_idx ON event_publication (listener_id, serialized_event);
11+
CREATE INDEX IF NOT EXISTS event_publication_serialized_event_hash_idx ON event_publication USING hash(serialized_event);
1212
CREATE INDEX IF NOT EXISTS event_publication_by_completion_date_idx ON event_publication (completion_date);

0 commit comments

Comments
 (0)