Re: Inheritance a burden?

From: Curt Sampson <cjs(at)cynic(dot)net>
To: Tony Reina <reina(at)nsi(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Inheritance a burden?
Date: 2002-07-20 05:17:08
Message-ID: Pine.NEB.4.44.0207201414080.553-100000@angelic.cynic.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 19 Jul 2002, Tony Reina wrote:

> Just out of curiosity, I built a new
> database with the same data but didn't use the inheritance (i.e. each
> table had its own copy of those common fields). It looks like about a
> 20% increase in execution speed when I run my programs side by side.

Have you tried it using the standard relational method of doing this?
(I.e., you put the common fields in one table, and the extra fields in
other tables, along with a foreign key relating the extra fields back
to the main table.) That would more accurately replacate what you were
doing with inheritance.

I have a suspicion, in fact, that inheritance may just be syntatic sugar
for doing this and adding a couple of views. :-)

Anyway, it could be that by denormalizing the data (copying it to the
other tables), you reduced the number of joins you do, and so you got a
performance increase.

cjs
--
Curt Sampson <cjs(at)cynic(dot)net> +81 90 7737 2974 http://www.netbsd.org
Don't you know, in this new Dark Age, we're all light. --XTC

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-07-20 05:43:19 Re: [HACKERS] [PATCH] Win32 native fixes after SSL updates (+more)
Previous Message Rod Taylor 2002-07-20 01:02:48 Re: preserving statistics settings