Is it necessary to have index for child table in following case? - Mailing list pgsql-general

From Yan Cheng Cheok
Subject Is it necessary to have index for child table in following case?
Date
Msg-id 2279.11710.qm@web65709.mail.ac4.yahoo.com
Whole thread Raw
Responses Re: Is it necessary to have index for child table in following case?  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
List pgsql-general
Due to the fact

"A serious limitation of the inheritance feature is that indexes (including unique constraints) and foreign key
constraintsonly apply to single tables, not to their inheritance children. This is true on both the referencing and
referencedsides 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
insertspeed 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





pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Questions on PostGreSQL Authentication mechanism...
Next
From: Lew
Date:
Subject: Re: PostgreSQL licence