Why no CREATE TEMP MATERIALIZED VIEW ?

Started by Ivan Vorasalmost 7 years ago5 messagesgeneral
Jump to latest
#1Ivan Voras
ivoras@gmail.com

Hello,

Out of curiosity, since there's CREATE TEMP VIEW, any particular reason
there's no CREATE TEMP MATERIALIZED VIEW?

Seems like it could be similar to a temp table.

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: Ivan Voras (#1)
Re: Why no CREATE TEMP MATERIALIZED VIEW ?

On Tue, Jul 16, 2019 at 9:29 AM Ivan Voras <ivoras@gmail.com> wrote:

Out of curiosity, since there's CREATE TEMP VIEW, any particular reason
there's no CREATE TEMP MATERIALIZED VIEW?

Seems like it could be similar to a temp table.

Probably a lack (absence) of use cases resulted in people deciding (or
defaulting) to not spend any effort in that area. Incremental maintenance
and refresh seem considerably less useful when only the current session can
see the table. Temp views and temp tables seem to provide sufficient
options in the session lifetime space.

David J.

#3Ron
ronljohnsonjr@gmail.com
In reply to: David G. Johnston (#2)
Re: Why no CREATE TEMP MATERIALIZED VIEW ?

On 7/16/19 11:56 AM, David G. Johnston wrote:

On Tue, Jul 16, 2019 at 9:29 AM Ivan Voras <ivoras@gmail.com
<mailto:ivoras@gmail.com>> wrote:

Out of curiosity, since there's CREATE TEMP VIEW, any particular
reason there's no CREATE TEMP MATERIALIZED VIEW?

Seems like it could be similar to a temp table.

Probably a lack (absence) of use cases resulted in people deciding (or
defaulting) to not spend any effort in that area. Incremental maintenance
and refresh seem considerably less useful when only the current session
can see the table. Temp views and temp tables seem to provide sufficient
options in the session lifetime space.

How different is a "*temp* materialized view" from a regular view?

--
Angular momentum makes the world go 'round.

#4Adam Brusselback
adambrusselback@gmail.com
In reply to: Ron (#3)
Re: Why no CREATE TEMP MATERIALIZED VIEW ?

How different is a "*temp* materialized view" from a regular view?

If it existed, it would be useful for cases when you need to reference that
view in multiple queries in the same session. I've gotten around this by
just using temp tables.

#5Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Ivan Voras (#1)
Re: Why no CREATE TEMP MATERIALIZED VIEW ?

On 2019-Jul-16, Ivan Voras wrote:

Hello,

Out of curiosity, since there's CREATE TEMP VIEW, any particular reason
there's no CREATE TEMP MATERIALIZED VIEW?

Because it hasn't been implemented. There is a patch, but it's not
done. See this thread:
/messages/by-id/CAKLmikNoQR4ZNg_wt=-hU-uUxV2cXVdveeRsMFjr2SAopVxDxw@mail.gmail.com

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