Re: constraint with reference to the same table

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Rudi Starcevic <rudi(at)oasis(dot)net(dot)au>
Cc: Postgres Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: constraint with reference to the same table
Date: 2003-05-15 00:46:47
Message-ID: 20030514174416.K52132-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, 15 May 2003, Rudi Starcevic wrote:

> Can I confirm what this means then ..
>
> For large table's each column with ref. inegritry I should create an
> index on those columns ?

In general, yes. There's always an additional cost with having additional
indexes to modifications to the table, so you need to balance the costs by
what sorts of queries you're doing. For example, if you're doing a
references constraint to a table that is mostly there for say providing a
nice name for something and those values aren't likely to change (and it's
okay if a change were expensive) then you wouldn't necessarily want the
additional index.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Stephan Szabo 2003-05-15 00:49:42 Re: constraint with reference to the same table
Previous Message Victor Yegorov 2003-05-15 00:12:39 Re: constraint with reference to the same table