Re: Indexing Strategy for Partitioned Table in PostgreSQL 15.13

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Mahesh Shetty <maheshetty20(at)gmail(dot)com>
Cc: "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Indexing Strategy for Partitioned Table in PostgreSQL 15.13
Date: 2025-08-04 05:35:13
Message-ID: CAKFQuwanhAmgSdh4ou=grR0FiwnM4dEojELmtHTmkyjtJEx5sw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Sunday, August 3, 2025, Mahesh Shetty <maheshetty20(at)gmail(dot)com> wrote:
>
> I have a large partitioned table with around 100 partitions, and we're
> planning to add an index to it. I'm a bit concerned about the potential
> impact and duration of the indexing process,
>

It will end very quickly…

> and I’d appreciate your inputs on the following:
>
> 1.
>
> If I run CREATE INDEX CONCURRENTLY on the *parent table*, will it
> automatically create indexes concurrently on all its partitions?
>
> Sometimes it’s best to just try (I didn’t though)…but the answer is
explicitly documented (see create index)

Concurrent builds for indexes on partitioned tables are currently not
supported. However, you may concurrently build the index on each partition
individually and then finally create the partitioned index non-concurrently
in order to reduce the time where writes to the partitioned table will be
locked out. In this case, building the partitioned index is a metadata only
operation.

David J.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ron Johnson 2025-08-04 05:53:12 Re: Vacuuming System DBs like postgres, template1
Previous Message Mahesh Shetty 2025-08-04 05:25:00 Indexing Strategy for Partitioned Table in PostgreSQL 15.13