Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id BB407475F13 for ; Tue, 28 Jan 2003 02:49:52 -0500 (EST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 45D87475DD0 for ; Tue, 28 Jan 2003 02:49:52 -0500 (EST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 9FF89D610; Mon, 27 Jan 2003 23:49:52 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 95B215C03; Mon, 27 Jan 2003 23:49:52 -0800 (PST) Date: Mon, 27 Jan 2003 23:49:52 -0800 (PST) From: Stephan Szabo To: Matt Mello Cc: PgSQL Performance ML Subject: Re: Indexing foreign keys In-Reply-To: <3E361946.4060000@spaceship.com> Message-ID: <20030127234454.N88775-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/368 X-Sequence-Number: 1015 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.