Indexes on inheriting tables

Поиск
Список
Период
Сортировка
От Toby Corkindale
Тема Indexes on inheriting tables
Дата
Msg-id 4E55A2C5.4050803@strategicdata.com.au
обсуждение исходный текст
Ответы Re: Indexes on inheriting tables
Re: Indexes on inheriting tables
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: "mark"
Дата:
Сообщение: Re: how is max_fsm_pages configured in 8.4
Следующее
От: Shoaib Mir
Дата:
Сообщение: Re: Indexes on inheriting tables