mirror of
https://github.com/zitadel/zitadel
synced 2024-11-22 00:39:36 +00:00
23bebc7e30
# Which Problems Are Solved During performance testing of the `eventstore.fields` table we found some long running queries which searched for the aggregate id. # How the Problems Are Solved A new index was added to the `eventstore.fields`-table called `f_aggregate_object_type_idx`. # Additional Changes None # Additional Context - Table was added in https://github.com/zitadel/zitadel/pull/8191 - Part of https://github.com/zitadel/zitadel/issues/7639
28 lines
555 B
Go
28 lines
555 B
Go
package setup
|
|
|
|
import (
|
|
"context"
|
|
_ "embed"
|
|
|
|
"github.com/zitadel/zitadel/internal/database"
|
|
"github.com/zitadel/zitadel/internal/eventstore"
|
|
)
|
|
|
|
var (
|
|
//go:embed 31.sql
|
|
addAggregateIndexToFields string
|
|
)
|
|
|
|
type AddAggregateIndexToFields struct {
|
|
dbClient *database.DB
|
|
}
|
|
|
|
func (mig *AddAggregateIndexToFields) Execute(ctx context.Context, _ eventstore.Event) error {
|
|
_, err := mig.dbClient.ExecContext(ctx, addAggregateIndexToFields)
|
|
return err
|
|
}
|
|
|
|
func (mig *AddAggregateIndexToFields) String() string {
|
|
return "31_add_aggregate_index_to_fields"
|
|
}
|