diff --git a/application/src/main/resources/db/migration/HTWO1_0_14__add_column_to_indexes.sql b/application/src/main/resources/db/migration/HTWO1_0_14__add_column_to_indexes.sql new file mode 100644 index 00000000..aba71c0c --- /dev/null +++ b/application/src/main/resources/db/migration/HTWO1_0_14__add_column_to_indexes.sql @@ -0,0 +1,9 @@ +drop index idxf6mchjaiqb65pytncc9l5fiw0; + +create index if not exists idxf6mchjaiqb65pytncc9l5fiw0 + on forwarding_events (channel_incoming, timestamp); + +drop index idx7ki7iilyupdjktdx80pd347au; + +create index if not exists idx7ki7iilyupdjktdx80pd347au + on forwarding_events (channel_outgoing, timestamp); \ No newline at end of file diff --git a/application/src/main/resources/db/migration/V1_0_14__add_column_to_indexes.sql b/application/src/main/resources/db/migration/V1_0_14__add_column_to_indexes.sql new file mode 100644 index 00000000..aba71c0c --- /dev/null +++ b/application/src/main/resources/db/migration/V1_0_14__add_column_to_indexes.sql @@ -0,0 +1,9 @@ +drop index idxf6mchjaiqb65pytncc9l5fiw0; + +create index if not exists idxf6mchjaiqb65pytncc9l5fiw0 + on forwarding_events (channel_incoming, timestamp); + +drop index idx7ki7iilyupdjktdx80pd347au; + +create index if not exists idx7ki7iilyupdjktdx80pd347au + on forwarding_events (channel_outgoing, timestamp); \ No newline at end of file diff --git a/forwarding-history/src/main/java/de/cotto/lndmanagej/forwardinghistory/persistence/ForwardingEventJpaDto.java b/forwarding-history/src/main/java/de/cotto/lndmanagej/forwardinghistory/persistence/ForwardingEventJpaDto.java index 72863695..0cd33ff8 100644 --- a/forwarding-history/src/main/java/de/cotto/lndmanagej/forwardinghistory/persistence/ForwardingEventJpaDto.java +++ b/forwarding-history/src/main/java/de/cotto/lndmanagej/forwardinghistory/persistence/ForwardingEventJpaDto.java @@ -14,7 +14,13 @@ @Entity @Table( name = "forwarding_events", - indexes = {@Index(columnList = "channelIncoming"), @Index(columnList = "channelOutgoing")} + indexes = {@Index( + name = "idxf6mchjaiqb65pytncc9l5fiw0", + columnList = "channelIncoming,timestamp" + ), @Index( + name = "idx7ki7iilyupdjktdx80pd347au", + columnList = "channelOutgoing,timestamp" + )} ) class ForwardingEventJpaDto { @Id