Skip to content

Commit

Permalink
GH-403 - Add database indexes in schema files.
Browse files Browse the repository at this point in the history
Original pull request: GH-411.
  • Loading branch information
maciejwalkowiak authored and odrotbohm committed Feb 20, 2024
1 parent aa4b34c commit f440af9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ CREATE TABLE IF NOT EXISTS EVENT_PUBLICATION
PUBLICATION_DATE TIMESTAMP(9) WITH TIME ZONE NOT NULL,
SERIALIZED_EVENT VARCHAR(4000) NOT NULL,
PRIMARY KEY (ID)
)
);
CREATE INDEX IF NOT EXISTS EVENT_PUBLICATION_LISTENER_ID_SERIALIZED_EVENT_IDX ON EVENT_PUBLICATION (LISTENER_ID, SERIALIZED_EVENT);
CREATE INDEX IF NOT EXISTS EVENT_PUBLICATION_COMPLETION_DATE_IDX ON EVENT_PUBLICATION (COMPLETION_DATE);
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ CREATE TABLE IF NOT EXISTS EVENT_PUBLICATION
SERIALIZED_EVENT VARCHAR(4000) NOT NULL,
PUBLICATION_DATE TIMESTAMP(6) NOT NULL,
COMPLETION_DATE TIMESTAMP(6) DEFAULT NULL NULL,
PRIMARY KEY (ID)
)
PRIMARY KEY (ID),
INDEX EVENT_PUBLICATION_LISTENER_ID_IDX (LISTENER_ID),
INDEX EVENT_PUBLICATION_COMPLETION_DATE_IDX (COMPLETION_DATE)
);
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ CREATE TABLE IF NOT EXISTS event_publication
publication_date TIMESTAMP WITH TIME ZONE NOT NULL,
completion_date TIMESTAMP WITH TIME ZONE,
PRIMARY KEY (id)
)
);
CREATE INDEX IF NOT EXISTS event_publication_listener_id_serialized_event_idx ON event_publication (listener_id, serialized_event);
CREATE INDEX IF NOT EXISTS event_publication_completion_date_idx ON event_publication (completion_date);

0 comments on commit f440af9

Please sign in to comment.