pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Neil Conway <neilc@samurai.com>
To: Sean P. Thomas <spt@ulanji.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Optimizing FK & PK performance...
Date: Tue, 16 Dec 2003 17:47:59 -0500
Message-ID: <87fzfkl6qo.fsf@mailbox.samurai.com> (raw)
In-Reply-To: <3FD89D72.8080508@ulanji.com>
References: <3FD89D72.8080508@ulanji.com>

"Sean P. Thomas" <spt@ulanji.com> writes:
> 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)
> );

These are equivalent -- the performance should be the same.

-Neil




view thread (3+ messages)  latest in thread

Message-ID: <87fzfkl6qo.fsf@mailbox.samurai.com>
Permalink:  ../87fzfkl6qo.fsf@mailbox.samurai.com/
Also on:    postgresql.org/message-id/87fzfkl6qo.fsf@mailbox.samurai.com

 · 

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: neilc@samurai.com, spt@ulanji.com
  Subject: Re: Optimizing FK & PK performance...
  In-Reply-To: <87fzfkl6qo.fsf@mailbox.samurai.com>

* 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