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
This commit is contained in:
Livio Spring
2025-08-25 15:07:00 +00:00
committed by GitHub
parent 20a213a3f2
commit 9621d357c0
+1
View File
@@ -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).