Re: Indexes on inheriting tables

From: Ondrej Ivanič <ondrej(dot)ivanic(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Indexes on inheriting tables
Date: 2011-08-25 02:44:23
Message-ID: CAM6mie+rN0ZnV3i6rjuX9X5nXaa5kBWa4C0pYKi=0Ya266xmsw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

On 25 August 2011 11:17, Toby Corkindale
<toby(dot)corkindale(at)strategicdata(dot)com(dot)au> wrote:
> Do I need to make sure I re-create every index on every child table I
> create?
> That would be.. annoying, at best.

Yes, it is little bit annoying but I like it. You don't need any index
on parent table but you have to create them "manually". I wrote simple
python script which creates partitions and required indexes in advance
(tables are partitioned by date).

I like the flexibility because you can have different indexex on
different partitions. For example, I discovered that adding index will
improve several queries. In the production I can't afford exclusive
lock (build index concurrently takes ages) so I updated and re-run the
script which re-created future partitions.

--
Ondrej Ivanic
(ondrej(dot)ivanic(at)gmail(dot)com)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2011-08-25 03:40:45 Re: [GENERAL] documentation suggestion
Previous Message Toby Corkindale 2011-08-25 02:24:56 Re: Indexes on inheriting tables