Is it necessary to have index for child table in following case?

From: Yan Cheng Cheok <yccheok(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Is it necessary to have index for child table in following case?
Date: 2010-02-03 02:58:39
Message-ID: 2279.11710.qm@web65709.mail.ac4.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Due to the fact

"A serious limitation of the inheritance feature is that indexes (including unique constraints) and foreign key constraints only apply to single tables, not to their inheritance children. This is true on both the referencing and referenced sides of a foreign key constraint. Thus, in the terms of the above example: "

When I use table inheritance to implement table partition :

measurement {
primary_key
foreign_key1
foreign_key2

create foreign_key1_index
create foreign_key2_index
}

measurement_1 inherit from measurement {
primary_key
foreign_key1
foreign_key2

create foreign_key1_index
create foreign_key2_index
}

However, I realize having foreign_key1_index and foreign_key2_index for child table measurement_1, make up my data insert speed slow down by factor of 2~3

I was wondering whether is it necessary for me to create index foreign_key1_index for child table measurement_1?

(1) All my SELECT query is performed on parent table measurement.
(2) All my data INSERT code is performed based on child table measurement_1.

Thanks!

Thanks and Regards
Yan Cheng CHEOK

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2010-02-03 03:58:35 Re: What is the graceful way to stop (kill) postmaster?
Previous Message Lew 2010-02-03 02:52:09 Re: PostgreSQL licence