mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-14 23:38:39 +02:00
postgres: drop redundant indices (#5715)
## Summary There are 3 indices in the postgres storage driver that are redundant. This PR drops them. ## Related issues - [ENG-2560](https://linear.app/pomerium/issue/ENG-2560/request-remove-redundant-database-indexes) ## Checklist - [x] reference any related issues - [ ] updated unit tests - [x] add appropriate label (`enhancement`, `bug`, `breaking`, `dependencies`, `ci`) - [x] ready for review
This commit is contained in:
parent
651a7e061f
commit
88c7a6537a
1 changed files with 15 additions and 0 deletions
|
@ -156,6 +156,21 @@ var migrations = []func(context.Context, pgx.Tx) error{
|
|||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
6: func(ctx context.Context, tx pgx.Tx) error {
|
||||
// these indices are redundant
|
||||
for _, q := range []string{
|
||||
`DROP INDEX ` + schemaName + `.` + recordsTableName + `_type_idx`,
|
||||
`DROP INDEX ` + schemaName + `.` + recordChangesTableName + `_version_idx`,
|
||||
`DROP INDEX ` + schemaName + `.` + recordChangesTableName + `_type_idx`,
|
||||
} {
|
||||
_, err := tx.Exec(ctx, q)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue