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

Поиск
Список
Период
Сортировка
От Yan Cheng Cheok
Тема Is it necessary to have index for child table in following case?
Дата
Msg-id 2279.11710.qm@web65709.mail.ac4.yahoo.com
обсуждение исходный текст
Ответы Re: Is it necessary to have index for child table in following case?
Список 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 по дате отправления:

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Questions on PostGreSQL Authentication mechanism...
Следующее
От: Lew
Дата:
Сообщение: Re: PostgreSQL licence