Re: Deferred constraint and delete performance

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-performance(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Franck Routier <franck(dot)routier(at)axege(dot)com>
Subject: Re: Deferred constraint and delete performance
Date: 2010-02-10 17:36:23
Message-ID: 201002101836.25964.andres@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wednesday 10 February 2010 15:56:40 Tom Lane wrote:
> Franck Routier <franck(dot)routier(at)axege(dot)com> writes:
> > I am wondering if deferring foreign key constraints (instead of
> > disableing them) would increase performance, compared to non deferred
> > constraints
>
> No, it wouldn't make any noticeable difference AFAICS. It would
> postpone the work from end-of-statement to end-of-transaction,
> but not make the work happen any more (or less) efficiently.
It could make a difference if the transaction is rather long and updates the
same row repeatedly because of better cache usage. But I admit thats a bit of
a constructed scenario (where one likely would get into trigger-queue size
problems as well)

Andres

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Carey 2010-02-10 18:04:38 Re: Linux I/O tuning: CFQ vs. deadline
Previous Message Jeff 2010-02-10 17:22:57 Re: Linux I/O tuning: CFQ vs. deadline