Re: Materialized views WIP patch

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
Cc: Tatsuo Ishii <ishii(at)postgresql(dot)org>, "stark(at)mit(dot)edu" <stark(at)mit(dot)edu>, "ants(at)cybertec(dot)at" <ants(at)cybertec(dot)at>, "hlinnakangas(at)vmware(dot)com" <hlinnakangas(at)vmware(dot)com>, "robertmhaas(at)gmail(dot)com" <robertmhaas(at)gmail(dot)com>, "michael(dot)paquier(at)gmail(dot)com" <michael(dot)paquier(at)gmail(dot)com>, "josh(at)agliodbs(dot)com" <josh(at)agliodbs(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Materialized views WIP patch
Date: 2013-03-07 15:55:29
Message-ID: 1362671729.11638.YahooMailNeo@web162904.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

David E. Wheeler <david(at)justatheory(dot)com> wrote:
> Kevin Grittner <kgrittn(at)ymail(dot)com> wrote:
>
>> I also think that something should be done about the
>> documentation for indexes.  Right now that always refers to a
>> "table".  It would clearly be awkward to change that to "table
>> or materialized view" everywhere.  I wonder if most of thosse
>> should be changed to "relation" with a few mentions that the
>> relation could be a table or a materialized view, or whether
>> some less intrusive change would be better.  Opinions welcome.
>
> Isn’t a materialized view really just a table that gets updated
> periodically?

Not exactly.  It is a relation which has some characteristics of a
view (including an entry in pg_rewrite exactly like that for a
view) and some characteristics of a table (including a heap and
optional indexes).  Whether it looks more like a table or more like
a view depends on how you tilt your head.  You could just as easily
say that it is really just a view which periodically caches its
results on disk.  They really are "their own thing".  As future
releases add more subtle "freshness" concepts, incremental updates,
and query rewrite that unique identity will become even more
conspicuous, I think.

> And isn’t a non-matierialized view also thought of as a
> “relation”?

Yes.  Tables, views, and materialized views are all relations.

> If the answer to both those questions is “yes,” I think the term
> should remain “table,” with a few mentions that the term includes
> materialized views (and excludes foreign tables).

And if the answers are "not exactly" and "yes"?

--
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2013-03-07 16:51:59 pgsql: Fix infinite-loop risk in fixempties() stage of regex compilatio
Previous Message Heikki Linnakangas 2013-03-07 10:34:33 pgsql: Fix tli history file fetching, broken by the archive after crash

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2013-03-07 16:18:45 Re: odd behavior in materialized view
Previous Message Ian Pilcher 2013-03-07 14:37:06 Re: Trust intermediate CA for client certificates