Re: Indexing foreign keys

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Matt Mello <alien(at)spaceship(dot)com>
Cc: PgSQL Performance ML <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Indexing foreign keys
Date: 2003-01-28 07:49:52
Message-ID: 20030127234454.N88775-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

On Mon, 27 Jan 2003, Matt Mello wrote:

> Yes. In IFX, when you create a FK, it seems to create indexes
> automatically for you, just like PG does with PK's.
>
> 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shridhar Daithankar 2003-01-28 07:53:03 Re: how much memory to allot to postgres?
Previous Message Patrick Nelson 2003-01-28 06:51:34 Re: Upgrading [SOLVED]

Browse pgsql-performance by date

  From Date Subject
Next Message Curt Sampson 2003-01-28 10:54:50 Re: 7.3.1 New install, large queries are slow
Previous Message Matt Mello 2003-01-28 05:51:31 Re: Indexing foreign keys