forked from ory/kratos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove more unused indices (ory#4186)
- Loading branch information
Showing
20 changed files
with
333 additions
and
45 deletions.
There are no files selected for viewing
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
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
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
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
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
persistence/sql/migrations/sql/20241029153900000001_identities.autocommit.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,13 @@ | ||
DROP INDEX identities_id_nid_idx; | ||
|
||
CREATE INDEX identity_recovery_addresses_identity_id_idx ON identity_recovery_addresses(identity_id ASC); | ||
DROP INDEX identity_recovery_addresses_status_via_idx; | ||
DROP INDEX identity_recovery_addresses_nid_identity_id_idx; | ||
DROP INDEX identity_recovery_addresses_nid_id_idx; | ||
DROP INDEX identity_recovery_addresses_id_nid_idx; | ||
|
||
CREATE INDEX identity_verifiable_addresses_identity_id_idx ON identity_verifiable_addresses (identity_id ASC); | ||
DROP INDEX identity_verifiable_addresses_status_via_idx; | ||
DROP INDEX identity_verifiable_addresses_nid_identity_id_idx; | ||
DROP INDEX identity_verifiable_addresses_nid_id_idx; | ||
DROP INDEX identity_verifiable_addresses_id_nid_idx; |
13 changes: 0 additions & 13 deletions
13
persistence/sql/migrations/sql/20241029153900000001_identities.up.sql
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
...ence/sql/migrations/sql/20241031094100000001_remaining_unused_indices.autocommit.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,56 @@ | ||
CREATE INDEX IF NOT EXISTS session_devices_id_nid_idx ON session_devices (id ASC, nid ASC); | ||
CREATE INDEX IF NOT EXISTS session_devices_session_id_nid_idx ON session_devices (session_id ASC, nid ASC); | ||
DROP INDEX IF EXISTS session_devices_nid_idx; | ||
DROP INDEX IF EXISTS session_devices_session_id_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS session_token_exchanges_nid_code_idx ON session_token_exchanges (init_code ASC, nid ASC); | ||
CREATE INDEX IF NOT EXISTS session_token_exchanges_nid_flow_id_idx ON session_token_exchanges (flow_id ASC, nid ASC); | ||
DROP INDEX IF EXISTS session_token_exchanges_flow_id_nid_init_code_idx; | ||
DROP INDEX IF EXISTS session_token_exchanges_nid_init_code_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS courier_messages_status_idx ON courier_messages (status ASC); | ||
CREATE INDEX IF NOT EXISTS courier_messages_nid_id_idx ON courier_messages (nid ASC, id ASC); | ||
CREATE INDEX IF NOT EXISTS courier_messages_id_nid_idx ON courier_messages (id ASC, nid ASC); | ||
CREATE INDEX IF NOT EXISTS courier_messages_nid_created_at_id_idx ON courier_messages (nid ASC, created_at DESC); | ||
DROP INDEX IF EXISTS courier_messages_status_id_idx; | ||
DROP INDEX IF EXISTS courier_messages_nid_id_created_at_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS continuity_containers_nid_id_idx ON continuity_containers (nid ASC, id ASC); | ||
CREATE INDEX IF NOT EXISTS continuity_containers_id_nid_idx ON continuity_containers (id ASC, nid ASC); | ||
CREATE INDEX IF NOT EXISTS continuity_containers_identity_id_nid_idx ON continuity_containers (identity_id ASC, nid ASC); | ||
DROP INDEX IF EXISTS continuity_containers_identity_id_idx; | ||
DROP INDEX IF EXISTS continuity_containers_nid_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS identity_verification_codes_nid_flow_id_idx ON identity_verification_codes (nid ASC, selfservice_verification_flow_id ASC); | ||
CREATE INDEX IF NOT EXISTS identity_verification_codes_id_nid_idx ON identity_verification_codes (id ASC, nid ASC); | ||
CREATE INDEX IF NOT EXISTS identity_verification_codes_verifiable_address_nid_idx ON identity_verification_codes (identity_verifiable_address_id ASC, nid ASC); | ||
DROP INDEX IF EXISTS identity_verification_codes_identity_verifiable_address_id_idx; | ||
DROP INDEX IF EXISTS identity_verification_codes_nid_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS identity_verification_tokens_nid_id_idx ON identity_verification_tokens (nid ASC, id ASC); | ||
CREATE INDEX IF NOT EXISTS identity_verification_tokens_id_nid_idx ON identity_verification_tokens (id ASC, nid ASC); | ||
CREATE INDEX IF NOT EXISTS identity_verification_tokens_token_nid_used_flow_id_idx ON identity_verification_tokens (nid ASC, token ASC, used ASC, selfservice_verification_flow_id ASC); | ||
DROP INDEX IF EXISTS identity_verification_tokens_nid_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS identity_registration_codes_nid_flow_id_idx ON identity_registration_codes (nid ASC, selfservice_registration_flow_id ASC); | ||
CREATE INDEX IF NOT EXISTS identity_registration_codes_id_nid_idx ON identity_registration_codes (id ASC, nid ASC); | ||
DROP INDEX IF EXISTS identity_registration_codes_nid_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS identity_recovery_tokens_nid_id_idx ON identity_recovery_tokens (nid ASC, id ASC); | ||
CREATE INDEX IF NOT EXISTS identity_recovery_tokens_id_nid_idx ON identity_recovery_tokens (id ASC, nid ASC); | ||
CREATE INDEX IF NOT EXISTS identity_recovery_tokens_token_nid_used_idx ON identity_recovery_tokens (nid ASC, token ASC, used ASC); | ||
CREATE INDEX IF NOT EXISTS identity_recovery_tokens_identity_id_nid_idx ON identity_recovery_tokens (identity_id ASC, nid ASC); | ||
DROP INDEX IF EXISTS identity_recovery_tokens_identity_id_idx; | ||
DROP INDEX IF EXISTS identity_recovery_tokens_nid_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS identity_recovery_codes_nid_flow_id_idx ON identity_recovery_codes (nid ASC, selfservice_recovery_flow_id ASC); | ||
CREATE INDEX IF NOT EXISTS identity_recovery_codes_id_nid_idx ON identity_recovery_codes (id ASC, nid ASC); | ||
CREATE INDEX IF NOT EXISTS identity_recovery_codes_identity_id_nid_idx ON identity_recovery_codes (identity_id ASC, nid ASC); | ||
CREATE INDEX IF NOT EXISTS identity_recovery_codes_identity_recovery_address_id_nid_idx ON identity_recovery_codes (identity_recovery_address_id ASC, nid ASC); | ||
DROP INDEX IF EXISTS identity_recovery_codes_identity_recovery_address_id_idx; | ||
DROP INDEX IF EXISTS identity_recovery_codes_identity_id_idx; | ||
DROP INDEX IF EXISTS identity_recovery_codes_nid_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS identity_login_codes_nid_flow_id_idx ON identity_login_codes (nid ASC, selfservice_login_flow_id ASC); | ||
CREATE INDEX IF NOT EXISTS identity_login_codes_id_nid_idx ON identity_login_codes (id ASC, nid ASC); | ||
DROP INDEX IF EXISTS identity_login_codes_nid_idx; |
56 changes: 56 additions & 0 deletions
56
...stence/sql/migrations/sql/20241031094100000001_remaining_unused_indices.autocommit.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,56 @@ | ||
CREATE INDEX IF NOT EXISTS session_devices_nid_idx ON session_devices (nid ASC); | ||
CREATE INDEX IF NOT EXISTS session_devices_session_id_idx ON session_devices (session_id ASC); | ||
DROP INDEX IF EXISTS session_devices_id_nid_idx; | ||
DROP INDEX IF EXISTS session_devices_session_id_nid_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS session_token_exchanges_flow_id_nid_init_code_idx ON session_token_exchanges (flow_id ASC, nid ASC, init_code ASC); | ||
CREATE INDEX IF NOT EXISTS session_token_exchanges_nid_init_code_idx ON session_token_exchanges (nid ASC, init_code ASC); | ||
DROP INDEX IF EXISTS session_token_exchanges_nid_code_idx; | ||
DROP INDEX IF EXISTS session_token_exchanges_nid_flow_id_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS courier_messages_status_id_idx ON courier_messages (status ASC, id ASC); | ||
CREATE INDEX IF NOT EXISTS courier_messages_nid_id_created_at_idx ON courier_messages (nid ASC, id ASC, created_at DESC); | ||
DROP INDEX IF EXISTS courier_messages_status_idx; | ||
DROP INDEX IF EXISTS courier_messages_nid_id_idx; | ||
DROP INDEX IF EXISTS courier_messages_id_nid_idx; | ||
DROP INDEX IF EXISTS courier_messages_nid_created_at_id_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS continuity_containers_identity_id_idx ON continuity_containers (identity_id ASC); | ||
CREATE INDEX IF NOT EXISTS continuity_containers_nid_idx ON continuity_containers (nid ASC); | ||
DROP INDEX IF EXISTS continuity_containers_nid_id_idx; | ||
DROP INDEX IF EXISTS continuity_containers_id_nid_idx; | ||
DROP INDEX IF EXISTS continuity_containers_identity_id_nid_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS identity_verification_codes_identity_verifiable_address_id_idx ON identity_verification_codes (identity_verifiable_address_id ASC); | ||
CREATE INDEX IF NOT EXISTS identity_verification_codes_nid_idx ON identity_verification_codes (nid ASC); | ||
DROP INDEX IF EXISTS identity_verification_codes_nid_flow_id_idx; | ||
DROP INDEX IF EXISTS identity_verification_codes_id_nid_idx; | ||
DROP INDEX IF EXISTS identity_verification_codes_verifiable_address_nid_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS identity_verification_tokens_nid_idx ON identity_verification_tokens (nid ASC); | ||
DROP INDEX IF EXISTS identity_verification_tokens_nid_id_idx; | ||
DROP INDEX IF EXISTS identity_verification_tokens_id_nid_idx; | ||
DROP INDEX IF EXISTS identity_verification_tokens_token_nid_used_flow_id_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS identity_registration_codes_nid_idx ON identity_registration_codes (nid ASC); | ||
DROP INDEX IF EXISTS identity_registration_codes_nid_flow_id_idx; | ||
DROP INDEX IF EXISTS identity_registration_codes_id_nid_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS identity_recovery_tokens_identity_id_idx ON identity_recovery_tokens (identity_id ASC); | ||
CREATE INDEX IF NOT EXISTS identity_recovery_tokens_nid_idx ON identity_recovery_tokens (nid ASC); | ||
DROP INDEX IF EXISTS identity_recovery_tokens_nid_id_idx; | ||
DROP INDEX IF EXISTS identity_recovery_tokens_id_nid_idx; | ||
DROP INDEX IF EXISTS identity_recovery_tokens_token_nid_used_idx; | ||
DROP INDEX IF EXISTS identity_recovery_tokens_identity_id_nid_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS identity_recovery_codes_identity_recovery_address_id_idx ON identity_recovery_codes (identity_recovery_address_id ASC); | ||
CREATE INDEX IF NOT EXISTS identity_recovery_codes_identity_id_idx ON identity_recovery_codes (identity_id ASC); | ||
CREATE INDEX IF NOT EXISTS identity_recovery_codes_nid_idx ON identity_recovery_codes (nid ASC); | ||
DROP INDEX IF EXISTS identity_recovery_codes_nid_flow_id_idx; | ||
DROP INDEX IF EXISTS identity_recovery_codes_id_nid_idx; | ||
DROP INDEX IF EXISTS identity_recovery_codes_identity_id_nid_idx; | ||
DROP INDEX IF EXISTS identity_recovery_codes_identity_recovery_address_id_nid_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS identity_login_codes_nid_idx ON identity_login_codes (nid ASC); | ||
DROP INDEX IF EXISTS identity_login_codes_nid_flow_id_idx; | ||
DROP INDEX IF EXISTS identity_login_codes_id_nid_idx; |
Oops, something went wrong.