-
Notifications
You must be signed in to change notification settings - Fork 971
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve secondary indices for self service tables
- Loading branch information
Showing
4 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
persistence/sql/migrations/sql/20241029102200000001_self_service.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
CREATE INDEX IF NOT EXISTS selfservice_login_flows_nid_id_idx ON selfservice_login_flows (nid ASC, id ASC); | ||
CREATE INDEX IF NOT EXISTS selfservice_login_flows_id_nid_idx ON selfservice_login_flows (id ASC, nid ASC); | ||
DROP INDEX IF EXISTS selfservice_login_flows_nid_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS selfservice_errors_errors_nid_id_idx (nid ASC, id ASC); | ||
DROP INDEX IF EXISTS selfservice_errors_errors_nid_idx (nid ASC); | ||
|
||
CREATE INDEX IF NOT EXISTS selfservice_recovery_flows_nid_id_idx ON selfservice_recovery_flows (nid ASC, id ASC); | ||
CREATE INDEX IF NOT EXISTS selfservice_recovery_flows_id_nid_idx ON selfservice_recovery_flows (id ASC, nid ASC); | ||
CREATE INDEX IF NOT EXISTS selfservice_recovery_flows_recovered_identity_id_nid_idx ON selfservice_recovery_flows (recovered_identity_id ASC, nid ASC); | ||
|
||
DROP INDEX IF EXISTS selfservice_recovery_flows_nid_idx; | ||
DROP INDEX IF EXISTS selfservice_recovery_flows_recovered_identity_id_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS selfservice_registration_flows_nid_id_idx ON selfservice_registration_flows (nid ASC, id ASC); | ||
CREATE INDEX IF NOT EXISTS selfservice_registration_flows_id_nid_idx ON selfservice_registration_flows (id ASC, nid ASC); | ||
|
||
DROP INDEX IF EXISTS selfservice_registration_flows_nid_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS selfservice_settings_flows_nid_id_idx ON selfservice_settings_flows (nid ASC, id ASC); | ||
CREATE INDEX IF NOT EXISTS selfservice_settings_flows_id_nid_idx ON selfservice_settings_flows (id ASC, nid ASC); | ||
CREATE INDEX IF NOT EXISTS selfservice_settings_flows_identity_id_nid_idx ON selfservice_settings_flows (identity_id ASC, nid ASC); | ||
|
||
DROP INDEX IF EXISTS selfservice_settings_flows_nid_idx; | ||
DROP INDEX IF EXISTS selfservice_settings_flows_identity_id_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS selfservice_verification_flows_nid_id_idx ON selfservice_verification_flows (nid ASC, id ASC); | ||
CREATE INDEX IF NOT EXISTS selfservice_verification_flows_id_nid_idx ON selfservice_verification_flows (id ASC, nid ASC); | ||
DROP INDEX IF EXISTS selfservice_verification_flows_nid_idx ON selfservice_verification_flows; |
26 changes: 26 additions & 0 deletions
26
persistence/sql/migrations/sql/20241029102200000001_self_service.mysql.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
CREATE INDEX IF NOT EXISTS selfservice_login_flows_nid_id_idx ON selfservice_login_flows (nid ASC, id ASC); | ||
CREATE INDEX IF NOT EXISTS selfservice_login_flows_id_nid_idx ON selfservice_login_flows (id ASC, nid ASC); | ||
DROP INDEX selfservice_login_flows_nid_idx ON selfservice_login_flows; | ||
|
||
CREATE INDEX IF NOT EXISTS selfservice_errors_errors_nid_id_idx (nid ASC, id ASC); | ||
DROP INDEX IF EXISTS selfservice_errors_errors_nid_idx (nid ASC); | ||
|
||
CREATE INDEX IF NOT EXISTS selfservice_recovery_flows_nid_id_idx ON selfservice_recovery_flows (nid ASC, id ASC); | ||
CREATE INDEX IF NOT EXISTS selfservice_recovery_flows_id_nid_idx ON selfservice_recovery_flows (id ASC, nid ASC); | ||
CREATE INDEX IF NOT EXISTS selfservice_recovery_flows_recovered_identity_id_nid_idx ON selfservice_recovery_flows (recovered_identity_id ASC, nid ASC); | ||
DROP INDEX selfservice_recovery_flows_nid_idx ON selfservice_recovery_flows; | ||
DROP INDEX selfservice_recovery_flows_recovered_identity_id_idx ON selfservice_recovery_flows; | ||
|
||
CREATE INDEX IF NOT EXISTS selfservice_registration_flows_nid_id_idx ON selfservice_registration_flows (nid ASC, id ASC); | ||
CREATE INDEX IF NOT EXISTS selfservice_registration_flows_id_nid_idx ON selfservice_registration_flows (id ASC, nid ASC); | ||
DROP INDEX selfservice_registration_flows_nid_idx ON selfservice_registration_flows; | ||
|
||
CREATE INDEX IF NOT EXISTS selfservice_settings_flows_nid_id_idx ON selfservice_settings_flows (nid ASC, id ASC); | ||
CREATE INDEX IF NOT EXISTS selfservice_settings_flows_id_nid_idx ON selfservice_settings_flows (id ASC, nid ASC); | ||
CREATE INDEX IF NOT EXISTS selfservice_settings_flows_identity_id_nid_idx ON selfservice_settings_flows (identity_id ASC, nid ASC); | ||
DROP INDEX selfservice_settings_flows_nid_idx ON selfservice_settings_flows; | ||
DROP INDEX selfservice_settings_flows_identity_id_idx ON selfservice_settings_flows; | ||
|
||
CREATE INDEX selfservice_verification_flows_nid_id_idx ON selfservice_verification_flows (nid ASC, id ASC); | ||
CREATE INDEX selfservice_verification_flows_id_nid_idx ON selfservice_verification_flows (id ASC, nid ASC); | ||
DROP INDEX selfservice_verification_flows_nid_idx ON selfservice_verification_flows; |
26 changes: 26 additions & 0 deletions
26
persistence/sql/migrations/sql/20241029102200000001_self_service.mysql.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
CREATE INDEX IF NOT EXISTS selfservice_login_flows_nid_idx ON selfservice_login_flows (nid ASC); | ||
DROP INDEX IF EXISTS selfservice_login_flows_nid_id_idx ON selfservice_login_flows; | ||
DROP INDEX IF EXISTS selfservice_login_flows_id_nid_idx ON selfservice_login_flows; | ||
|
||
CREATE INDEX IF NOT EXISTS selfservice_errors_errors_nid_idx (nid ASC); | ||
DROP INDEX IF EXISTS selfservice_errors_errors_nid_id_idx (nid ASC, id ASC); | ||
|
||
CREATE INDEX IF NOT EXISTS selfservice_recovery_flows_nid_idx ON selfservice_recovery_flows (nid ASC); | ||
CREATE INDEX IF NOT EXISTS selfservice_recovery_flows_recovered_identity_id_idx ON selfservice_recovery_flows (recovered_identity_id ASC); | ||
DROP INDEX IF EXISTS selfservice_recovery_flows_nid_id_idx ON selfservice_recovery_flows; | ||
DROP INDEX IF EXISTS selfservice_recovery_flows_id_nid_idx ON selfservice_recovery_flows; | ||
DROP INDEX IF EXISTS selfservice_recovery_flows_recovered_identity_id_nid_idx ON selfservice_recovery_flows; | ||
|
||
CREATE INDEX IF NOT EXISTS selfservice_registration_flows_nid_idx ON selfservice_registration_flows (nid ASC); | ||
DROP INDEX IF EXISTS selfservice_registration_flows_nid_id_idx ON selfservice_registration_flows; | ||
DROP INDEX IF EXISTS selfservice_registration_flows_id_nid_idx ON selfservice_registration_flows; | ||
|
||
CREATE INDEX IF NOT EXISTS selfservice_settings_flows_nid_idx ON selfservice_settings_flows (nid ASC); | ||
CREATE INDEX IF NOT EXISTS selfservice_settings_flows_identity_id_idx ON selfservice_settings_flows (identity_id ASC); | ||
DROP INDEX IF EXISTS selfservice_settings_flows_nid_id_idx ON selfservice_settings_flows; | ||
DROP INDEX IF EXISTS selfservice_settings_flows_id_nid_idx ON selfservice_settings_flows; | ||
DROP INDEX IF EXISTS selfservice_settings_flows_identity_id_nid_idx ON selfservice_settings_flows; | ||
|
||
CREATE INDEX IF NOT EXISTS selfservice_verification_flows_nid_idx ON selfservice_verification_flows (nid ASC); | ||
DROP INDEX IF EXISTS selfservice_verification_flows_nid_id_idx ON selfservice_verification_flows; | ||
DROP INDEX IF EXISTS selfservice_verification_flows_id_nid_idx ON selfservice_verification_flows; |
26 changes: 26 additions & 0 deletions
26
persistence/sql/migrations/sql/20241029102200000001_self_service.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
CREATE INDEX IF NOT EXISTS selfservice_login_flows_nid_idx ON selfservice_login_flows (nid ASC); | ||
DROP INDEX IF EXISTS selfservice_login_flows_nid_id_idx; | ||
DROP INDEX IF EXISTS selfservice_login_flows_id_nid_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS selfservice_errors_errors_nid_idx (nid ASC); | ||
DROP INDEX IF EXISTS selfservice_errors_errors_nid_id_idx (nid ASC, id ASC); | ||
|
||
CREATE INDEX IF NOT EXISTS selfservice_recovery_flows_recovered_identity_id_idx ON selfservice_recovery_flows (recovered_identity_id ASC); | ||
CREATE INDEX IF NOT EXISTS selfservice_recovery_flows_nid_idx ON selfservice_recovery_flows (nid ASC); | ||
DROP INDEX IF EXISTS selfservice_recovery_flows_nid_id_idx; | ||
DROP INDEX IF EXISTS selfservice_recovery_flows_id_nid_idx; | ||
DROP INDEX IF EXISTS selfservice_recovery_flows_recovered_identity_id_nid_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS selfservice_registration_flows_nid_idx ON selfservice_registration_flows (nid ASC); | ||
DROP INDEX IF EXISTS selfservice_registration_flows_nid_id_idx; | ||
DROP INDEX IF EXISTS selfservice_registration_flows_id_nid_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS selfservice_settings_flows_nid_idx ON selfservice_settings_flows (nid ASC); | ||
CREATE INDEX IF NOT EXISTS selfservice_settings_flows_identity_id_idx ON selfservice_settings_flows (identity_id ASC); | ||
DROP INDEX IF EXISTS selfservice_settings_flows_nid_id_idx; | ||
DROP INDEX IF EXISTS selfservice_settings_flows_id_nid_idx; | ||
DROP INDEX IF EXISTS selfservice_settings_flows_identity_id_nid_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS selfservice_verification_flows_nid_idx ON selfservice_verification_flows (nid ASC); | ||
DROP INDEX IF EXISTS selfservice_verification_flows_nid_id_idx; | ||
DROP INDEX IF EXISTS selfservice_verification_flows_id_nid_idx; |