Re: postgres constraint triggers - Mailing list pgsql-performance

From Ben Chobot
Subject Re: postgres constraint triggers
Date
Msg-id 3F7F288F-A4DC-4AFD-B538-FD6C9A943C65@silentmedia.com
Whole thread Raw
In response to postgres constraint triggers  ("Maria L. Wilson" <Maria.L.Wilson-1@nasa.gov>)
Responses Re: postgres constraint triggers  (Craig Ringer <ringerc@ringerc.id.au>)
List pgsql-performance
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. 

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Ineffective autovacuum
Next
From: Royce Ausburn
Date:
Subject: Re: Ineffective autovacuum