Re: Index bloat and REINDEX/VACUUM optimization for partial index

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: jayaprabhakar k <jayaprabhakar(at)gmail(dot)com>
Cc: psql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Index bloat and REINDEX/VACUUM optimization for partial index
Date: 2023-08-29 01:49:13
Message-ID: CAH2-Wz=Szg0BZfuFW=ixj-mQQOSAgCHdS9kv+Lvvxv5M_JLS_A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, Aug 28, 2023 at 5:33 PM jayaprabhakar k <jayaprabhakar(at)gmail(dot)com> wrote:
> REINDEX requires a full table scan
>
> Roughly create a new index, rename index, drop old index.
> REINDEX is not incremental. running reindex frequently does not reduce the future reindex time.

You didn't say which Postgres version you're on. Note that Postgres 14
can deal with index bloat a lot better than earlier versions could.
This is known to work well with partial indexes. See:

https://www.postgresql.org/message-id/flat/CAL9smLAjt9mZC2%3DqBeJwuNPq7KMAYGTWWQw_hvA-Lfo0b3ycow%40mail.gmail.com

--
Peter Geoghegan

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Philippe Pepiot 2023-08-29 07:40:06 Range partitioning query performance with date_trunc (vs timescaledb)
Previous Message jayaprabhakar k 2023-08-29 00:32:38 Index bloat and REINDEX/VACUUM optimization for partial index