Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


      


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux