Re: Materialized views don't show up in information_schema

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Sehrope Sarkuni <sehrope(at)jackdb(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Materialized views don't show up in information_schema
Date: 2014-10-29 17:10:00
Message-ID: CA+Tgmoa0zEz+n1U1kzPtvHN3cEyvvkOdFWoA=KwHnORJyDnnuA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 27, 2014 at 11:45 AM, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
>> But I think it's the wrong thing anyway, because it presumes that,
>> when Kevin chose to make materialized views a different relkind and a
>> different object type, rather than just a property of an object, he
>> made the wrong call, and I don't agree with that. I think he got it
>> exactly right. A materialized view is really much more like a table
>> than a view: it has storage and can be vacuumed, clustered, analyzed,
>> and so on. That's far more significant IMV than the difference
>> between a table and unlogged table.
>
> I don't think Kevin was wrong to use a different relkind, but I don't
> buy into the argument that a different relkind means it's not a view.
> As for the other comments, I agree that a matview is *more* than a view,
> but at its base, in my view (pun intended), it's still a view. Why not
> call it a materialized query?

Your view seems very odd to me. The access characteristics of a
materialized view are completely unlike those of a view, and
completely like those of a table. It has storage, and maybe indexes.
Trying to say that it's the same kind of an object as something that
has neither seems really odd. The overlap between the operations you
can do on a materialized view and those you can do on a view is really
pretty small.

It might have been better if the database industry had settled on some
name for this kind of object that didn't reuse the word "view", but at
this point I think we're stuck with the fact that adding the word
"materialized" makes it into a completely different kind of object.
You wouldn't expect to find "butter" and "peanut butter" in the same
aisle at the supermarket....

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-10-29 17:18:23 Re: Autovacuum fails to keep visibility map up-to-date in mostly-insert-only-tables
Previous Message Andres Freund 2014-10-29 17:07:01 Re: Directory/File Access Permissions for COPY and Generic File Access Functions