Skip site navigation (1) Skip section navigation (2)

Re: Optimizing FK & PK performance...

From: Neil Conway <neilc(at)samurai(dot)com>
To: "Sean P(dot) Thomas" <spt(at)ulanji(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Optimizing FK & PK performance...
Date: 2003-12-16 22:47:59
Message-ID: 87fzfkl6qo.fsf@mailbox.samurai.com (view raw or flat)
Thread:
Lists: pgsql-performance
"Sean P. Thomas" <spt(at)ulanji(dot)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


In response to

pgsql-performance by date

Next:From: Neil ConwayDate: 2003-12-16 22:51:18
Subject: Re: Why is VACUUM ANALYZE <table> so slow?
Previous:From: Hannu KrosingDate: 2003-12-16 21:24:45
Subject: Re: Excessive rows/tuples seriously degrading query

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group