Indexes on inheriting tables - Mailing list pgsql-general

From Toby Corkindale
Subject Indexes on inheriting tables
Date
Msg-id 4E55A2C5.4050803@strategicdata.com.au
Whole thread Raw
Responses Re: Indexes on inheriting tables
Re: Indexes on inheriting tables
List 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 by date:

Previous
From: "mark"
Date:
Subject: Re: how is max_fsm_pages configured in 8.4
Next
From: Shoaib Mir
Date:
Subject: Re: Indexes on inheriting tables