Re: Inheritance a burden? - Mailing list pgsql-hackers

From Curt Sampson
Subject Re: Inheritance a burden?
Date
Msg-id Pine.NEB.4.44.0207201414080.553-100000@angelic.cynic.net
Whole thread Raw
In response to Inheritance a burden?  (reina@nsi.edu (Tony Reina))
Responses Re: Inheritance a burden?  (Tony Reina <reina@nsi.edu>)
List 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@cynic.net>   +81 90 7737 2974   http://www.netbsd.org   Don't you know, in this new Dark Age, we're
alllight.  --XTC
 



pgsql-hackers by date:

Previous
From: Rod Taylor
Date:
Subject: Re: preserving statistics settings
Next
From: Bruce Momjian
Date:
Subject: Re: [PATCH] Win32 native fixes after SSL updates (+more)