Re: Feature: temporary materialized views

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Mitar <mmitar(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Feature: temporary materialized views
Date: 2018-12-26 17:00:22
Message-ID: 20181226170022.w2pmdkdbkj2fqbbx@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-Dec-25, Mitar wrote:

> Sometimes materialized views are used to cache a complex query on
> which a client works. But after client disconnects, the materialized
> view could be deleted. Regular VIEWs and TABLEs both have support for
> temporary versions which get automatically dropped at the end of the
> session. It seems it is easy to add the same thing for materialized
> views as well. See attached PoC patch.

I think MVs that are dropped at session end are a sensible feature. I
probably wouldn't go as far as allowing ON COMMIT actions, though, so
this much effort is the right amount.

I think if you really want to do this you should just use OptTemp, and
delete OptNoLog. Of course, you need to add tests and patch the docs.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mitar 2018-12-26 17:07:22 Re: Feature: triggers on materialized views
Previous Message Robert Haas 2018-12-26 16:50:18 Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)