Re: inherits index

From: Scott Ribe <scott_ribe(at)killerbytes(dot)com>
To: Matthew Peter <survivedsushi(at)yahoo(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: inherits index
Date: 2006-01-02 17:19:53
Message-ID: BFDEAEC9.3C0AC%scott_ribe@killerbytes.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

My understanding is that you will need to set up the indexes on the child
table in order to do any good for queries on the child table. Also, you have
foreign key (an other, like primary key, I think) constraints are not
inherited and have to be repeated on each table.

Think of it like this: table inheritance in PostgreSQL is not much of a
convenience for defining your schema as it doesn't provide much except for
inheritance of columns. To me it's most useful for certain types of queries
over the shared attributes of similar classes of entities, where you can
query the base table rather than constructing clumsy unions over the common
columns (or having one-to-one relationships, making querying the "base"
attributes easy, but requiring joins for everything dealing with "child"
entities).

--
Scott Ribe
scott_ribe(at)killerbytes(dot)com
http://www.killerbytes.com/
(303) 665-7007 voice

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jon Jensen 2006-01-02 17:33:50 Re: pg_dump error codes
Previous Message cmire 2006-01-02 17:04:25 postgresql-8.1.1 on SuSE 10.0 install issue