Remove redundant indexes that duplicate primary keys#1900
Open
AkramBitar wants to merge 1 commit into
Open
Conversation
11a832d to
c2e8611
Compare
Signed-off-by: AkramBitar <akram@il.ibm.com>
c2e8611 to
e4947a8
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1891 (indexing work for #1873).
Removes six indexes that duplicated — or were a leading prefix of — their table's
PRIMARY KEY. A non-unique index that is an exact prefix of the PK's btree provides no read benefit (the PK index already serves those prefix lookups on both PostgreSQL and SQLite), but every one of them is maintained on eachINSERT/UPDATE. Dropping them is a pure write-path win.identity.goidx_ic_id_typePRIMARY KEY(id, type, url)(exact)identity.goidx_auditsPRIMARY KEY(identity_hash)(exact)identity.goidx_signersPRIMARY KEY(identity_hash)(exact)wallet.goidx_identity_hash_and_wallet_and_rolePRIMARY KEY(identity_hash, wallet_id, role_id)(exact)wallet.goidx_identity_hashtokens.goidx_tx_idPRIMARY KEY(tx_id, idx)