Re: [PERFORM] Optimizing FK & PK performance...

2003-12-16 Thread Christopher Kings-Lynne
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,
 namevarchar(40),
 PRIMARY KEY(did)
);
CREATE TABLE distributors (
 did integer PRIMARY KEY,
 namevarchar(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

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
 subscribe-nomail command to [EMAIL PROTECTED] so that your
 message can get through to the mailing list cleanly


Re: [PERFORM] Optimizing FK & PK performance...

2003-12-16 Thread Neil Conway
"Sean P. Thomas" <[EMAIL PROTECTED]> 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,
>   namevarchar(40),
>   PRIMARY KEY(did)
> );
>
> CREATE TABLE distributors (
>   did integer PRIMARY KEY,
>   namevarchar(40)
> );

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

-Neil


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])