Re: Any reason not to use inheritance?

From: Thomas F(dot)O'Connell <tfo(at)sitening(dot)com>
To: jao(at)geophile(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Any reason not to use inheritance?
Date: 2004-09-20 21:13:23
Message-ID: E7E2154B-0B49-11D9-99C2-000D93AE0944@sitening.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Just beware that inheritance is not a complete methodology in postgres.
The implementation has limitations. For instance, indexes in parent
tables will not be inherited by children.

I've yet to encounter a scenario that actually required inheritance.
I've used it a few times, but when I have, the end result always
required a bit more work because of the incomplete aspects of the
postgres implementation (namely constraints and indexes).

-tfo

On Sep 20, 2004, at 4:03 PM, jao(at)geophile(dot)com wrote:

> My company's product uses Postgres 7.4.3. Postgres is working well for
> us, and we've worked through many performance issues by tweaking the
> schema, indexes, and posgresql.conf settings.
>
> Inheritance would be useful for our application, but we did not use
> this feature initially. We're about to revise part of our application,
> and this would be a good time to introduce inheritance -- it's a good
> fit for our data model, and it would greatly simplify some of our
> upcoming work.
>
> I'd really like to use inheritance, but not if I'm asking for trouble.
> The question is whether there are any performance-related surprises
> lurking. Our use of inheritance would be very simple:
>
> - The columns that would be inherited are not involved in any primary
> or foreign keys.
>
> - One of the columns would be used in indexes on some of the child
> tables. In these cases, the index would combine an inherited column
> with a column declared in an inheriting table.
>
> - Queries will often restrict the inherited indexed column.
>
> - We'll occasionally ORDER BY inherited columns.
>
> Any reason not to use inheritance?
>
> Jack Orenstein

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Gamache 2004-09-20 21:17:38 Re: using database for queuing operations?
Previous Message Scott Ribe 2004-09-20 21:08:24 Re: using database for queuing operations?