pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ben Chobot <bench@silentmedia.com>
To: Maria.L.Wilson-1@nasa.gov
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: postgres constraint triggers
Date: Mon, 26 Sep 2011 22:54:10 -0600
Message-ID: <3F7F288F-A4DC-4AFD-B538-FD6C9A943C65@silentmedia.com> (raw)
In-Reply-To: <4E80ADD7.8090008@nasa.gov>
References: <4E80ADD7.8090008@nasa.gov>

On Sep 26, 2011, at 10:52 AM, Maria L. Wilson wrote:

> Our first try to solve this problem has been to convert these triggers into a constraint trigger which allows for DEFERRABLE INITIALLY DEFERRED flags.  This, we are finding, is forcing the trigger function to run after the triggering transaction is completed.  We believe this will fix our locking problem and hopefully speed up our inserts again.
> 
> Any comments or past experiences would certainly be helpful!

My memory is fuzzy but as I recall, a possible downside to using deferred constraints was increased memory usage, though I cannot see how at the moment. Regardless, I think the upshot is that they aren't without their cost but as long as you aren't doing massive transactions that cost is probably one that you can afford to pay without much worry. =

view thread (4+ messages)  latest in thread

Message-ID: <3F7F288F-A4DC-4AFD-B538-FD6C9A943C65@silentmedia.com>
Permalink:  ../3F7F288F-A4DC-4AFD-B538-FD6C9A943C65@silentmedia.com/
Also on:    postgresql.org/message-id/3F7F288F-A4DC-4AFD-B538-FD6C9A943C65@silentmedia.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: bench@silentmedia.com, Maria.L.Wilson-1@nasa.gov
  Subject: Re: postgres constraint triggers
  In-Reply-To: <3F7F288F-A4DC-4AFD-B538-FD6C9A943C65@silentmedia.com>
  References: <4E80ADD7.8090008@nasa.gov> <3F7F288F-A4DC-4AFD-B538-FD6C9A943C65@silentmedia.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox