pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Marc G. Fournier <scrappy@postgresql.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: CHECK vs REFERENCES
Date: Sat, 10 Sep 2005 07:06:27 -0600
Message-ID: <20050910130627.GA45586@winnie.fuhr.org> (raw)
In-Reply-To: <20050910010141.O1170@ganymede.hub.org>
References: <20050910001821.E1170@ganymede.hub.org>
	<20050910034907.GA40382@winnie.fuhr.org>
	<20050910010141.O1170@ganymede.hub.org>

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



view thread (5+ messages)  latest in thread

Message-ID: <20050910130627.GA45586@winnie.fuhr.org>
Permalink:  ../20050910130627.GA45586@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20050910130627.GA45586@winnie.fuhr.org

 · 

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: mike@fuhr.org, scrappy@postgresql.org
  Subject: Re: CHECK vs REFERENCES
  In-Reply-To: <20050910130627.GA45586@winnie.fuhr.org>

* 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