fix: index assets table on urn column#165
Merged
StewartJingga merged 1 commit intoraystack:mainfrom Aug 16, 2022
Merged
Conversation
- Drop unique index on (urn, type, service) concurrently. This ensures that we don't take an exclusive lock on the table which would lock out selects, inserts, updates and deletes on the index's table. - Create a unique index on urn column in the assets table.
598b85a to
1319449
Compare
Contributor
|
@sudo-suhas I might've missed something here, but what is the reason for splitting the migration? can they be in one use case? |
Contributor
Author
|
Already included the reason as a comment in one of the migration files: -- By default, golang-migrate wraps multiple SQL statements in a transaction.
-- Dropping index concurrently is not allowed in a transaction. So the drop
-- statement needs to be the only statement in the migration.Command output for failed migrate run: |
StewartJingga
approved these changes
Aug 16, 2022
Pull Request Test Coverage Report for Build 2865844096
💛 - Coveralls |
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.
that we don't take an exclusive lock on the table which would lock out
selects, inserts, updates and deletes on the index's table.
Related to #162.