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
Support materialized views #18758
Comments
PostgreSQL has view definitions in |
There are some interesting questions when implementing this feature, one is what is the |
|
@janpio what's the progress on this? |
We are currently gathering feedback to our You can most probably create a manual model representing your materialized view (even via Introspection if you for example create a non-materialized copy of it) and then use a raw query to trigger the materialization. |
As a temporary work-around specifically for PostgreSQL, until materialized views are implemented, I found the following worked pretty well for me. I had a really complicated matview with over 30 cols and didn't fancy manually creating it.
ℹ️
...and away you go, query it like a normal view. |
We are also extensively using materialized views. Setting up the views by hand once is fine and we can work around it. What we have found to be quite unexpected and inconvenient is the fact that introspection is removing the manually added views again. Maybe the feature request could be split into a task of 2. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Try a view on top of the materialized view.
This seems to work at least migrator-wise. Hmm even access without this to materialized view with the |
We implemented support for views via #678 and #17335, but as materialized views are special (they need some Client API and would also need to be migrated differently) we currently do not introspect them yet at all and also have no special construct in PSL to differentiate they from normal views.
(If you handwrite a
views
definition, it might work to be able to access the views. No guarantees though.)The text was updated successfully, but these errors were encountered: