pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matt Mello <alien@spaceship.com>
To: PgSQL Performance ML <pgsql-performance@postgresql.org>
Subject: Re: Indexing foreign keys
Date: Mon, 27 Jan 2003 23:46:46 -0600
Message-ID: <3E361946.4060000@spaceship.com> (raw)
In-Reply-To: <1043702012.9896.72.camel@haggis>
References: <3E35991D.5050704@spaceship.com>
	<1043702012.9896.72.camel@haggis>

Ron Johnson wrote:
> When you say "I created an index on those 2 fields", so you mean on
> the fields in the 400K row table, or on the keys in the "fact tables"
> that the 400K row table?
> 
> Also, in IFX, could the creation of the foreign indexes have implicitly
> created indexes?
> The reason I ask is that this is what happens in Pg when you create a
> PK.
> 

The 400K row table has 2 fields that are FK fields.  The already-indexed 
PK fields that they reference are in another table.  I just recently 
added indexes to the 2 FK fields in the 400K row table to get the speed 
boost.

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.

-- 
Matt Mello




view thread (12+ messages)  latest in thread

Message-ID: <3E361946.4060000@spaceship.com>
Permalink:  ../3E361946.4060000@spaceship.com/
Also on:    postgresql.org/message-id/3E361946.4060000@spaceship.com

 · 

reply

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: alien@spaceship.com
  Subject: Re: Indexing foreign keys
  In-Reply-To: <3E361946.4060000@spaceship.com>
  References: <3E35991D.5050704@spaceship.com> <1043702012.9896.72.camel@haggis> <3E361946.4060000@spaceship.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