How does PG Inheritance work?

From: "Announce" <truthhurts(at)insightbb(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: How does PG Inheritance work?
Date: 2005-11-27 23:23:16
Message-ID: KBEKKNMFLELKGIADDEPEEEBKCDAA.truthhurts@insightbb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

How does Postgres internally handle inheritance under the following
scenario?
Using sample tables similar to a previous post:

CREATE TABLE employee(id primary key, name varchar, salary numeric(6,2));
CREATE TABLE programmer(language varchar, project varchar) INHERITS
(employee);
CREATE TABLE representative (region varchar) INHERITS (employee);

Let's say for example's sake, there are 10 million rows of PROGRAMMER data
but only 100 rows of representative data. Will a query (select, update,
insert, etc) on the REPRESENTATIVE table take a performance hit because of
this?

It seems like the child-table is really not concrete. It seems like it is
just a "pointer" to certain rows in the parent table which is then able to
discern which inherited "table-type" it is.

Thanks,

Aaron

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message 2005-11-28 00:05:13 PostgreSQL 8.0.1-2 WinXP Services
Previous Message Oliver Elphick 2005-11-27 22:24:38 Re: could not create unique index, table contains