-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove first two unused indexes #376
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4538890
Remove first two unused indexes
neekolas 6107c1e
Don't make it concurrent
neekolas 0d3000e
Just use select 1 for down
neekolas f7d71b2
Drop sort index too
neekolas af467ee
Merge branch 'main' into 04-19-remove_first_two_unused_indexes
neekolas 4ec60f8
Merge branch 'main' into 04-19-remove_first_two_unused_indexes
neekolas a0646c6
Update PR
neekolas 861eb30
Rename migration
neekolas bd183b3
Remove if not exists
neekolas b51c458
Fix splitting
neekolas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
pkg/migrations/messages/20240419172419_remove-unused-indexes-pt-1.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,5 @@ | ||
SET statement_timeout = 0; | ||
|
||
--bun:split | ||
|
||
CREATE INDEX CONCURRENTLY IF NOT EXISTS message_pubsubTopic_idx ON public.message (pubsubTopic); | ||
4 changes: 4 additions & 0 deletions
4
pkg/migrations/messages/20240419172419_remove-unused-indexes-pt-1.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,4 @@ | ||
SET statement_timeout = 0; | ||
|
||
DROP INDEX CONCURRENTLY IF EXISTS messageindex; | ||
neekolas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
DROP INDEX CONCURRENTLY IF EXISTS message_pubsubtopic_idx; |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without CONCURRENTLY, does the server start up extremely slowly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also take a lock of the entire table and block reads
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having problems actually running concurrent index drops in a migration (for some reason it is trying to run the migration in a tx, which is not allowed). I might just make this non-concurrent but manually drop the index concurrently in prod first.