Re: Question about foreign key - Mailing list pgsql-general

From Christoph Dalitz
Subject Re: Question about foreign key
Date
Msg-id 20021107155258.75f63524.christoph.dalitz@hs-niederrhein.de
Whole thread Raw
In response to Question about foreign key  (Terence Leung <tcmleung@yahoo.com>)
List pgsql-general
> Date: Wed, 6 Nov 2002 03:49:49 -0800 (PST)
> From: Terence Leung <tcmleung@yahoo.com>
>
>     Hi, I am Terence and using Postgresql 7.0 in linux
>
You should consider an upgrade to 7.2 or (if you can wait some months)
to 7.3. These versions are *strong* improvements.

>  "select login_name,quest_name FROM sys_quest_list
> JOIN sys_user ON owner_id=sys_user.id"
>
> Can the added foreign key improve the above sql
> performance so that it can search faster
>
No.

>   or the foreign key can only maintain the data
> integrity but cannot make the search faster?
>
Yes.

For better search performance, do a CREATE INDEX and don't forget to
ANALYZE the table.

Christoph Dalitz

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: parser error: 9223372036854775807
Next
From: "Shridhar Daithankar"
Date:
Subject: Re: [HACKERS] Database replication... - Mission Critica