Change materialized views to be refreshed concurrently to avoid locks (#29015)

This commit is contained in:
Eugen Rochko 2024-01-30 19:21:30 +01:00 committed by GitHub
commit fa0ba67753
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 11 additions and 7 deletions

View file

@ -6,7 +6,7 @@ class UpdateFollowRecommendationsToVersion2 < ActiveRecord::Migration[6.1]
def up
drop_view :follow_recommendations
create_view :follow_recommendations, version: 2, materialized: { no_data: true }
create_view :follow_recommendations, version: 2, materialized: true
# To be able to refresh the view concurrently,
# at least one unique index is required