Re: CHECK vs REFERENCES - Mailing list pgsql-performance

From Michael Fuhr
Subject Re: CHECK vs REFERENCES
Date
Msg-id 20050910130627.GA45586@winnie.fuhr.org
Whole thread Raw
In response to Re: CHECK vs REFERENCES  ("Marc G. Fournier" <scrappy@postgresql.org>)
List pgsql-performance
On Sat, Sep 10, 2005 at 01:03:03AM -0300, Marc G. Fournier wrote:
> On Fri, 9 Sep 2005, Michael Fuhr wrote:
> >INSERT INTO test_check SELECT 1 FROM generate_series(1, 100000);
> >INSERT 0 100000
> >Time: 3492.344 ms
> >
> >INSERT INTO test_fk SELECT 1 FROM generate_series(1, 100000);
> >INSERT 0 100000
> >Time: 23578.853 ms
>
> Yowch, I expected CHECK to be better ... but not so significantly ... I
> figured I'd be saving milliseconds, which, on a busy server, would add up
> fast ... but not 10k' of milliseconds ...

Results will differ depending on the table structure: if you're
indexing ten columns and have five triggers then the foreign key
check will have less of an overall impact.

--
Michael Fuhr

pgsql-performance by date:

Previous
From: Chris Browne
Date:
Subject: Re: please comment on cpu 32 bit or 64 bit
Next
From: Mark Dilger
Date:
Subject: performance discrepancy indexing one column versus two columns