-
Notifications
You must be signed in to change notification settings - Fork 10
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
Improve performance of Active Storage lookups #2826 #3428
Changes from 5 commits
340588a
acd8c4b
230bc7e
d32b526
6c5d845
e7246cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class ActiveStorageAttachments < ActiveRecord::Migration[7.1] | ||
disable_ddl_transaction! | ||
def change | ||
add_index :active_storage_attachments, :record_id, algorithm: :concurrently, if_not_exists: true | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uses "CREATE INDEX CONCURRENTLY" to avoid locking the DB table. For details: https://www.postgresql.org/docs/current/sql-createindex.html#SQL-CREATEINDEX-CONCURRENTLY |
||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Disable transaction as incompatible with "concurrent" index creation.