mirror of
https://github.com/zitadel/zitadel.git
synced 2025-11-10 01:53:04 +00:00
fix: improve performance (#4300)
## Note This release requires a setup step to fully improve performance. Be sure to start ZITADEL with an appropriate command (zitadel start-from-init / start-from-setup) ## Changes - fix: only run projection scheduler on active instances - fix: set default for concurrent instances of projections to 1 (for scheduling) - fix: create more indexes on eventstore.events table - fix: get current sequence for token check (improve reread performance)
This commit is contained in:
36
cmd/setup/04.go
Normal file
36
cmd/setup/04.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package setup
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"embed"
|
||||
)
|
||||
|
||||
var (
|
||||
//go:embed 04/cockroach/index.sql
|
||||
//go:embed 04/postgres/index.sql
|
||||
stmts embed.FS
|
||||
)
|
||||
|
||||
type EventstoreIndexes struct {
|
||||
dbClient *sql.DB
|
||||
dbType string
|
||||
}
|
||||
|
||||
func (mig *EventstoreIndexes) Execute(ctx context.Context) error {
|
||||
stmt, err := readStmt(mig.dbType)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = mig.dbClient.ExecContext(ctx, stmt)
|
||||
return err
|
||||
}
|
||||
|
||||
func (mig *EventstoreIndexes) String() string {
|
||||
return "04_eventstore_indexes"
|
||||
}
|
||||
|
||||
func readStmt(typ string) (string, error) {
|
||||
stmt, err := stmts.ReadFile("04/" + typ + "/index.sql")
|
||||
return string(stmt), err
|
||||
}
|
||||
Reference in New Issue
Block a user