Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 884F8479285 for ; Tue, 28 Jan 2003 17:56:47 -0500 (EST) Received: from mail.com-stock.com (mail.com-stock.com [204.255.137.254]) by postgresql.org (Postfix) with ESMTP id D283A4771CD for ; Tue, 28 Jan 2003 16:27:20 -0500 (EST) Received: by mail.com-stock.com (Postfix, from userid 1000) id 00D8713E; Tue, 28 Jan 2003 16:27:14 -0500 (EST) Received: from deimos (deimos.com-stock.com [204.255.137.120]) by mail.com-stock.com (Postfix) with SMTP id B2524DA36 for ; Tue, 28 Jan 2003 16:27:13 -0500 (EST) Message-ID: <020301c2c715$03cef290$7889ffcc@comstock.com> From: "Gregory Wood" To: "PostgreSQL-General" References: <20030127234454.N88775-100000@megazone23.bigpanda.com> Subject: Re: [PERFORM] Indexing foreign keys Date: Tue, 28 Jan 2003 16:23:08 -0500 Organization: Comstock Net Services MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/1274 X-Sequence-Number: 36395 > > 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