Re: Weird Database Performance problem! - Mailing list pgsql-performance

From Richard Huxton
Subject Re: Weird Database Performance problem!
Date
Msg-id 411D1548.20408@archonet.com
Whole thread Raw
In response to Weird Database Performance problem!  ("Arash Zaryoun" <Arash_Zaryoun@CBC.CA>)
List pgsql-performance
Arash Zaryoun wrote:
> Hi Richard,
>
> Thanks for your prompt reply. It fixed the problem.
> Just one more question: Do I need to create an index for FKs?

You don't _need_ to, but on the referring side (e.g. table GCTBALLOT in
your example) PostgreSQL won't create one automatically.

Of course, the primary-key side will already have an index being used as
part of the constraint.

I've cc:ed the list on this, the question pops up quite commonly.

--
   Richard Huxton
   Archonet Ltd

pgsql-performance by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: fsync vs open_sync
Next
From: "borajetta"
Date:
Subject: REINDEX needed because of index corruption need help ASAP