Search Postgresql Archives

Re: inherits index

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

 



My understanding is that you will need to set up the indexes on the child
table in order to do any good for queries on the child table. Also, you have
foreign key (an other, like primary key, I think) constraints are not
inherited and have to be repeated on each table.

Think of it like this: table inheritance in PostgreSQL is not much of a
convenience for defining your schema as it doesn't provide much except for
inheritance of columns. To me it's most useful for certain types of queries
over the shared attributes of similar classes of entities, where you can
query the base table rather than constructing clumsy unions over the common
columns (or having one-to-one relationships, making querying the "base"
attributes easy, but requiring joins for everything dealing with "child"
entities).


-- 
Scott Ribe
scott_ribe@xxxxxxxxxxxxxxx
http://www.killerbytes.com/
(303) 665-7007 voice




[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