Re: Question about foreign key

From: Christoph Dalitz <christoph(dot)dalitz(at)hs-niederrhein(dot)de>
To: Terence Leung <tcmleung(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Question about foreign key
Date: 2002-11-07 14:52:58
Message-ID: 20021107155258.75f63524.christoph.dalitz@hs-niederrhein.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Date: Wed, 6 Nov 2002 03:49:49 -0800 (PST)
> From: Terence Leung <tcmleung(at)yahoo(dot)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

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-11-07 14:55:29 Re: [SQL] Problem: Referential Integrity Constraints lost
Previous Message Oskar Berggren 2002-11-07 14:13:00 Re: Q!