Re: Materialized views WIP patch

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Greg Stark <stark(at)mit(dot)edu>, Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Materialized views WIP patch
Date: 2013-02-28 16:08:50
Message-ID: 512F8112.3000607@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 28.02.2013 16:55, Robert Haas wrote:
> On Sat, Feb 23, 2013 at 8:00 AM, Michael Paquier
> <michael(dot)paquier(at)gmail(dot)com> wrote:
>> it is. http://www.postgresql.org/docs/9.2/static/sql-reset.html
>> DISCARD would be better.
>
> Well, personally, I'm in favor of either TRUNCATE or ALTER
> MATERIALIZED VIEW ... DISCARD. I think it's a dangerous precedent to
> suppose that we're going to start using DISCARD for things that have
> nothing to do with the existing meanings of DISCARD. Number one, I
> think it's confusing. Number two, it's currently possible to
> determine whether something is DDL, DML, or other by looking at the
> first word of the command. If we throw that out the window we may
> cause performance issues for connection pooling software that tries to
> be clever like that.

FWIW, I totally agree with that. From that point of view, the best thing
would be to tack this onto the REFRESH command, perhaps something like:

REFRESH matview INVALIDATE;
REFRESH matview UNREFRESH;
REFRESH matview DISCARD;

It's a bit weird that the command is called REFRESH, if the effect is
the exact opposite of refreshing it. And we usually do have two separate
commands for doing something and undoing the same; CREATE - DROP,
PREPARE - DEALLOCATE, LISTEN - UNLISTEN, and so forth.

I think we're being too hung up on avoiding new (unreserved) keywords.
Yes, the grammar is large because of so many keywords, but surely
there's some better solution to that than adopt syntax that sucks. Let's
invent a new keyword (INVALIDATE? UNREFRESH?), and deal with the grammar
bloat separately.

- Heikki

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2013-02-28 16:32:24 Re: pgsql: Add support for piping COPY to/from an external program.
Previous Message Tom Lane 2013-02-28 16:00:17 Re: Materialized views WIP patch

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2013-02-28 16:37:27 Building on MinGW
Previous Message Tom Lane 2013-02-28 16:00:17 Re: Materialized views WIP patch