From 1f6a1b306169f956ec231bd50183de867674527d Mon Sep 17 00:00:00 2001 From: Livio Spring Date: Mon, 25 Aug 2025 17:07:00 +0200 Subject: [PATCH] fix(service ping): improve systemID search query to use index (#10566) # Which Problems Are Solved We noticed that the startup for v4 was way slower than v3. A query without an instanceID filter could be traced back to the systemID query of the service ping. # How the Problems Are Solved A an empty instanceID to the query to ensure it used an appropriate index. # Additional Changes None # Additional Context - Closes https://github.com/zitadel/zitadel/issues/10390 - backport to v4.x (cherry picked from commit 9621d357c00c1961cef165c0b2ce2aff965fa3ec) --- internal/serviceping/worker.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/serviceping/worker.go b/internal/serviceping/worker.go index b95dd77fa10..4455138586d 100644 --- a/internal/serviceping/worker.go +++ b/internal/serviceping/worker.go @@ -207,6 +207,7 @@ func (s *systemIDReducer) AppendEvents(events ...eventstore.Event) { func (s *systemIDReducer) Query() *eventstore.SearchQueryBuilder { return eventstore.NewSearchQueryBuilder(eventstore.ColumnsEvent). + InstanceID(""). // to make sure we can use an appropriate index AddQuery(). AggregateTypes(system.AggregateType). EventTypes(system.IDGeneratedType).