Re: constraint with reference to the same table
Stephan Szabo <sszabo@megazone23.bigpanda.com>
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Rudi Starcevic <rudi@oasis.net.au>
Cc: Postgres Performance <pgsql-performance@postgresql.org>
Date: 2003-05-15T00:46:47Z
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.