-1

Does the postgresql materialize view rebuild the entire table on a REFRESH command? Is it efficient to TRIGGER a refresh to a materialized view that is dependent on a table with heavy writes?

Brian Yeh
  • 3,119
  • 3
  • 26
  • 40

1 Answers1

0

Yes, REFRESH MATERIALIZED VIEW will rebuild the whole materialized view.

It would be very inefficient to do that after every data modufication.

What you could do is to use a normal table instead of a materialized view and write a trigger that keeps the table updated.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263