pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Richard van den Berg <richard.vandenberg@trust-factory.com>
Cc: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Cc: pgsql-performance@postgresql.org
Subject: Re: Foreign key slows down copy/insert
Date: Thu, 14 Apr 2005 09:11:41 -0700 (PDT)
Message-ID: <20050414090931.P42874@megazone.bigpanda.com> (raw)
In-Reply-To: <742.1113491145@sss.pgh.pa.us>
References: <425E6045.4060201@trust-factory.com>
	<425E792B.4020500@familyhealth.com.au>
	<425E7D96.6020201@trust-factory.com>
	<20050414074154.M38465@megazone.bigpanda.com>
	<742.1113491145@sss.pgh.pa.us>

On Thu, 14 Apr 2005, Tom Lane wrote:

> Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> > ... At some point, if we can work out how to do all the semantics
> > properly, it'd probably be possible to replace the insert type check with
> > a per-statement check which would be somewhere in between.  That requires
> > access to the affected rows inside the trigger which I don't believe is
> > available currently.
>
> Not necessarily.  It occurs to me that maybe what we need is "lossy
> storage" of the trigger events.  If we could detect that the queue of
> pending checks for a particular FK is getting large, we could discard
> the whole queue and replace it with one entry that says "run the
> wholesale check again when we are ready to fire triggers".  I'm not

Yeah, but there's a potentially large middle ground where neither our
current plan nor check the entire table is particularly good for that we
might be able to handle better.  It'd be nice to also fall back to check
the entire table for even larger changes.



view thread (24+ messages)  latest in thread

Message-ID: <20050414090931.P42874@megazone.bigpanda.com>
Permalink:  ../20050414090931.P42874@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20050414090931.P42874@megazone.bigpanda.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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: sszabo@megazone.bigpanda.com, tgl@sss.pgh.pa.us, richard.vandenberg@trust-factory.com, chriskl@familyhealth.com.au
  Subject: Re: Foreign key slows down copy/insert
  In-Reply-To: <20050414090931.P42874@megazone.bigpanda.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