From c4c56a25dcf597a0c75cfd108b5bf07003f89f1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Wed, 10 Sep 2025 12:26:22 +0300 Subject: [PATCH] perf: drop instance position index (#10626) # Which Problems Are Solved There was an left-behind index introduced to optimize the old and removed event execution handler. The index confuses prostgres and it sometimes picks this index in favor of the projection specific index. This sometimes leads to bad query performance in the projectio handlers. # How the Problems Are Solved Drop the index # Additional Changes - none # Additional Context - Forgotten in https://github.com/zitadel/zitadel/pull/10564 (cherry picked from commit 54554b8fb98cb160d844cdc413468e641cb0d34e) --- cmd/setup/54.go | 2 +- cmd/setup/54.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/setup/54.go b/cmd/setup/54.go index e4a2e438620..1b882e8c713 100644 --- a/cmd/setup/54.go +++ b/cmd/setup/54.go @@ -23,5 +23,5 @@ func (mig *InstancePositionIndex) Execute(ctx context.Context, _ eventstore.Even } func (mig *InstancePositionIndex) String() string { - return "54_instance_position_index_again" + return "54_instance_position_index_remove_again" } diff --git a/cmd/setup/54.sql b/cmd/setup/54.sql index 1dca8c75754..927bd2aa9b7 100644 --- a/cmd/setup/54.sql +++ b/cmd/setup/54.sql @@ -1 +1 @@ -CREATE INDEX CONCURRENTLY IF NOT EXISTS es_instance_position ON eventstore.events2 (instance_id, position); +DROP INDEX IF EXISTS eventstore.es_instance_position;