Search Postgresql Archives

Indexes on inheriting tables

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

 



Hi,
I'm using Pg 9.0 and inheritance to do table partitioning.

A simple example would be:
CREATE TABLE foo (
  id INTEGER PRIMARY KEY,
  thing VARCHAR(32)
);
CREATE INDEX foo_thing_idx ON foo(thing);
CREATE TABLE foo_1 () INHERITS (foo);


I read that foreign key constraints wouldn't be inherited. However I am also finding that indexes aren't inherited either.

eg. EXPLAIN SELECT id FROM foo WHERE thing='something';
will indicate that an indexed scan will be done over foo, followed by a sequential scan over foo_1.

Do I need to make sure I re-create every index on every child table I create?
That would be.. annoying, at best.

Is there a way to enable inheritance of indexes too?

Cheers,
Toby

--
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