Re: Delta Materialized View Refreshes?

From: Jeremy Finzel <finzelj(at)gmail(dot)com>
To: jd(at)rsa(dot)pub
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Delta Materialized View Refreshes?
Date: 2018-09-14 20:25:45
Message-ID: CAMa1XUjzet2_9EsCJ=W1WHQg6RVuWKUQm44NuADAkqCS1PWsxA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
>
> Could you apply something similar using triggers?
> One question would be how PG would identify changes to existing rows -
> using the replication facilities to essentially replicate into the view?
> This would be quite tricky I reckon. Otherwise a change to the underlying
> table may not propagate correctly to the MV.
>

That's not what I had in mind. I only mean when REFRESH MATERIALIZED VIEW
is run, it gathers the results of the view in memory, then instead of
essentially "wiping and reloading" the table, it would only write the
differences. So if 90% of the rows would be the same as before the
refresh, we only update 10% of the rows.

This would also mean materialized views could get bloated just like tables.

Thanks,
Jeremy

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-09-14 20:46:26 Re: stat() on Windows might cause error if target file is larger than 4GB
Previous Message Tom Lane 2018-09-14 20:17:39 Re: Code of Conduct plan