Skip to content

Commit

Permalink
Add jailed index (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky authored Nov 12, 2024
1 parent 5b497aa commit 936a8ab
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/storage/postgres/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,15 @@ func createIndices(ctx context.Context, conn *database.Bun) error {
Exec(ctx); err != nil {
return err
}
if _, err := tx.NewCreateIndex().
IfNotExists().
Model((*storage.Validator)(nil)).
Index("validator_jailed_idx").
ColumnExpr("(1)").
Where("NOT jailed").
Exec(ctx); err != nil {
return err
}

// Blob log
if _, err := tx.NewCreateIndex().
Expand Down

0 comments on commit 936a8ab

Please sign in to comment.