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 9621d357c0)
This commit is contained in:
Livio Spring
2025-08-25 17:07:00 +02:00
parent c9c88be44e
commit 1f6a1b3061

View File

@@ -207,6 +207,7 @@ func (s *systemIDReducer) AppendEvents(events ...eventstore.Event) {
func (s *systemIDReducer) Query() *eventstore.SearchQueryBuilder { func (s *systemIDReducer) Query() *eventstore.SearchQueryBuilder {
return eventstore.NewSearchQueryBuilder(eventstore.ColumnsEvent). return eventstore.NewSearchQueryBuilder(eventstore.ColumnsEvent).
InstanceID(""). // to make sure we can use an appropriate index
AddQuery(). AddQuery().
AggregateTypes(system.AggregateType). AggregateTypes(system.AggregateType).
EventTypes(system.IDGeneratedType). EventTypes(system.IDGeneratedType).