Delta Materialized View Refreshes? - Mailing list pgsql-hackers

From Jeremy Finzel
Subject Delta Materialized View Refreshes?
Date
Msg-id CAMa1XUi7YkHptJS==rJNZkEuOWVvPKnw9SFL=AABm8f2Aawnvw@mail.gmail.com
Whole thread Raw
Responses Re: Delta Materialized View Refreshes?  (Jordan Deitch <jd@rsa.pub>)
List pgsql-hackers
To me the biggest disadvantage of using a materialized view instead of a table delta load for an ETL process, for example, is that the materialized view is very inefficient in terms of write overhead, for of course it rewrites the whole set of data in the table, meaning heap, indexes, WAL and everything that goes with it.

Couldn't this be coded to only update changed records?  As an example, we have a materialized view definition that holds summarized data on customer records, and it only changes when new customers are added.  It would be so nice to only write that change.

I recognize that it may take longer, but for our environment as I'm sure is true of many others, we are often much more excited about reducing write churn than read churn.

If in fact it could be option, I am curious if we could leverage the work being done on the merge functionality to do a "merge" from the materialized view definition into the actual persistent object.

If people really like the current functionality, then at least it could be an option like REFRESH MATERIALIZED VIEW DELTA or something - I dunno I am more interested in just having the feature!

Many thanks for any thoughts on this subject.
Jeremy

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: stat() on Windows might cause error if target file is larger than 4GB
Next
From: Jeremy Finzel
Date:
Subject: Logical replication to partitioned subscriber