Re: Optimizing FK & PK performance... - Mailing list pgsql-performance

From Neil Conway
Subject Re: Optimizing FK & PK performance...
Date
Msg-id 87fzfkl6qo.fsf@mailbox.samurai.com
Whole thread Raw
In response to Optimizing FK & PK performance...  ("Sean P. Thomas" <spt@ulanji.com>)
List pgsql-performance
"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


pgsql-performance by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: Excessive rows/tuples seriously degrading query
Next
From: Neil Conway
Date:
Subject: Re: Why is VACUUM ANALYZE so slow?