Skip to content

Commit

Permalink
Merge pull request #3428 from ualbertalib/2826_db_performance
Browse files Browse the repository at this point in the history
Improve performance of Active Storage lookups #2826
  • Loading branch information
ConnorSheremeta authored Apr 22, 2024
2 parents 22a9809 + e7246cc commit 9ed276d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ New entries in this file should aim to provide a meaningful amount of informatio

## [Unreleased]

### Fixed
* Improves performance of Active Storage lookups via adding an table index.
Requires a db:migration that creates the index concurrently thus does not
lock the DB table [PR#3428](https://github.com/ualbertalib/jupiter/pull/3428)

### Changed
* #3420: Update bundler to match version in production [PR#3433](https://github.com/ualbertalib/jupiter/pull/3433)

Expand Down
6 changes: 6 additions & 0 deletions db/migrate/20240327203605_active_storage_attachments.rb
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
end
3 changes: 2 additions & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9ed276d

Please sign in to comment.