pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
To: Sean P. Thomas <spt@ulanji.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Optimizing FK & PK performance...
Date: Wed, 17 Dec 2003 09:17:28 +0800
Message-ID: <3FDFAEA8.1090607@familyhealth.com.au> (raw)
In-Reply-To: <3FD89D72.8080508@ulanji.com>
References: <3FD89D72.8080508@ulanji.com>

> 1. Is there any performance difference for declaring a primary or 
> foreign key a column or table contraint?  From the documentation, which 
> way is faster and/or scales better:
> 
> 
> CREATE TABLE distributors (
>      did     integer,
>      name    varchar(40),
>      PRIMARY KEY(did)
> );
> 
> CREATE TABLE distributors (
>      did     integer PRIMARY KEY,
>      name    varchar(40)
> );

No difference - they're parsed to exactly the same thing (the first 
version).

> 2. Is DEFERRABLE and INITIALLY IMMEDIATE or INITIALLY DEFERRABLE 
> perferred for performance?  We generally have very small transactions 
> (web app) but we utilize a model of:

No idea on this one :/

Chris




view thread (3+ messages)

Message-ID: <3FDFAEA8.1090607@familyhealth.com.au>
Permalink:  ../3FDFAEA8.1090607@familyhealth.com.au/
Also on:    postgresql.org/message-id/3FDFAEA8.1090607@familyhealth.com.au

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: chriskl@familyhealth.com.au, spt@ulanji.com
  Subject: Re: Optimizing FK & PK performance...
  In-Reply-To: <3FDFAEA8.1090607@familyhealth.com.au>
  References: <3FD89D72.8080508@ulanji.com> <3FDFAEA8.1090607@familyhealth.com.au>

* 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