Re: [PERFORM] Indexing foreign keys - Mailing list pgsql-general

From Gregory Wood
Subject Re: [PERFORM] Indexing foreign keys
Date
Msg-id 020301c2c715$03cef290$7889ffcc@comstock.com
Whole thread Raw
List pgsql-general
> > In fact, I can't imagine a situation where you would NOT want a FK
> > indexed.  I guess there must be one, or else I'm sure the developers
> > would have already added auto-creation of indexes to the FK creation, as
> > well.
>
> Any case where the pk table is small enough and the values are fairly
> evenly distributed so that the index isn't very selective.  You end up not
> using the index anyway because it's not selective and you pay the costs
> involved in keeping it up to date.

Or you want an index on two or more fields that includes the FK as the
primary field. No sense in making two indexes.

Greg


pgsql-general by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: If you are trying to unsubscribe, please READ THIS ...
Next
From: Chris Gamache
Date:
Subject: Re: 7.3 LOCK TABLE problem