Re: Statement Level Deferred Triggers

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Statement Level Deferred Triggers
Date: 2009-10-24 01:49:13
Message-ID: 603c8f070910231849w7e4b7ackae70adec0801226f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 23, 2009 at 7:29 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> Hi all,
>
> I would like to hear some opinions before starting to take a stab at
> implementing $subject.
> My current use case is updating materialized views at the end of the
> transaction so that they appear consistent to the outside.
> Updating them on every row changed is far too expensive - so every change is
> logged and depending on the size of the changeset the views are recomputed
> completely or incrementally.
> Currently this is hacked up by using deferred constraint triggers - which are
> row level only... (i.e. the first run trigger deletes the whole changelog so
> that all following triggers have nearly nothing to do).
> This is neither nice from an architectural point nor from an performance
> angle.
>
> I am sure most of you can think of other use cases.
>
> Opinions?

This same use case has arisen for me in the past, with slightly
different details.

...Robert

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2009-10-24 03:09:35 misleading comments in pgbench
Previous Message João Eugenio Marynowski 2009-10-24 01:36:01 Re: table corrupted