Re: Foreign key slows down copy/insert - Mailing list pgsql-performance

From Stephan Szabo
Subject Re: Foreign key slows down copy/insert
Date
Msg-id 20050414090931.P42874@megazone.bigpanda.com
Whole thread Raw
In response to Re: Foreign key slows down copy/insert  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
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.

pgsql-performance by date:

Previous
From: Dawid Kuroczko
Date:
Subject: Re: speed of querry?
Next
From: Tom Lane
Date:
Subject: Re: speed of querry?