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

Add method to check materialized view population #396

Merged
merged 1 commit into from
Sep 29, 2023
Merged

Conversation

derekprior
Copy link
Contributor

@derekprior derekprior commented Sep 29, 2023

REFRESH MATERIALIZED VIEW CONCURRENTLY doesn't work for a view which is not populated, even it has unique index. This method is useful to perform concurrent refresh if it's possible.

Real use case in Rails will be like this:

  • Database is loaded from structure.sql to run specs, but the view isn't populated yet so concurrent refresh is not possible. We want to fallback to normal(non-concurrent) refresh in this case.
  • After initial population, views are expected to be refreshed concurrently. It's possible because the view is already populated.

REFRESH MATERIALIZED VIEW CONCURRENTLY doesn't work for a view which is
not populated, even it has unique index. This method is useful to
perform concurrent refresh if it's possible.

Real use case in Rails will be like this:

* Database is loaded from structure.sql to run specs, but the view isn't
  populated yet so concurrent refresh is not possible. We want to
  fallback to normal(non-concurrent) refresh in this case.
* After initial population, views are expected to be refreshed
  concurrently. It's possible because the view is already populated.

Co-authored By: Derek Prior <[email protected]>
@derekprior
Copy link
Contributor Author

Replaces #249

@derekprior derekprior merged commit 104d888 into main Sep 29, 2023
@derekprior derekprior deleted the dp-populated branch September 29, 2023 22:59
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.

3 participants