From 5b1267ae93c894c0317c120138bcaeeee47618f1 Mon Sep 17 00:00:00 2001 From: Silvan Date: Wed, 8 Dec 2021 17:18:54 +0100 Subject: [PATCH] fix(eventstore): add index to reduce db workload (#2813) --- migrations/cockroach/V1.102__event_idx.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 migrations/cockroach/V1.102__event_idx.sql diff --git a/migrations/cockroach/V1.102__event_idx.sql b/migrations/cockroach/V1.102__event_idx.sql new file mode 100644 index 0000000000..2365e48038 --- /dev/null +++ b/migrations/cockroach/V1.102__event_idx.sql @@ -0,0 +1,15 @@ +CREATE INDEX agg_type_seq ON eventstore.events + (aggregate_type, event_sequence DESC) +STORING ( + id + , event_type + , aggregate_id + , aggregate_version + , previous_aggregate_sequence + , creation_date + , event_data + , editor_user + , editor_service + , resource_owner + , previous_aggregate_type_sequence +); \ No newline at end of file