Skip to content
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

Make migrations concurrent #3113

Merged
merged 1 commit into from
Jan 30, 2025
Merged

Make migrations concurrent #3113

merged 1 commit into from
Jan 30, 2025

Conversation

brucebolt
Copy link
Member

The migrations to add new indexes were previously locking all writes to the editions table at the time of running.

As one of the migrations is slow (several minutes), this caused degraded performance of the application.

Making them concurrent to remove the need for the tables to be locked.

Trello card

@brucebolt brucebolt marked this pull request as ready for review January 30, 2025 11:56
The migrations to add new indexes were previously locking all writes to
the editions table at the time of running.

As one of the migrations is slow (several minutes), this caused degraded
performance of the application.

Making them concurrent to remove the need for the tables to be locked.

Concurrent indexes must be created outside of a transaction [1].

1: https://thoughtbot.com/blog/how-to-create-postgres-indexes-concurrently-in
@brucebolt brucebolt force-pushed the make-migrations-concurrent branch from 9ece577 to f7f1635 Compare January 30, 2025 12:18
@brucebolt brucebolt enabled auto-merge January 30, 2025 12:18
@brucebolt brucebolt merged commit 59ef62d into main Jan 30, 2025
12 checks passed
@brucebolt brucebolt deleted the make-migrations-concurrent branch January 30, 2025 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants