From: Gregory Wood <gregw@com-stock.com>
To: PostgreSQL-General <pgsql-general@postgresql.org>
Subject: Re: [PERFORM] Indexing foreign keys
Date: Tue, 28 Jan 2003 16:23:08 -0500
Message-ID: <020301c2c715$03cef290$7889ffcc@comstock.com> (raw)
References: <20030127234454.N88775-100000@megazone23.bigpanda.com>
> > 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: gregw@com-stock.com, pgsql-general@postgresql.org
Subject: Re: [PERFORM] Indexing foreign keys
In-Reply-To: <020301c2c715$03cef290$7889ffcc@comstock.com>
References: <20030127234454.N88775-100000@megazone23.bigpanda.com> <020301c2c715$03cef290$7889ffcc@comstock.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox