Re: CLUSTER progress: wrong index_rebuild_count for tables with TOAST

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Adam Lee <adam8157(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Antonin Houska <ah(at)cybertec(dot)at>, Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Subject: Re: CLUSTER progress: wrong index_rebuild_count for tables with TOAST
Date: 2026-09-09 11:19:15
Message-ID: CAHGQGwFUsrBvTurkSU8TEc=DZTunqteUXrasseqNMT7AMBZKRw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 26, 2026 at 3:46 PM Adam Lee <adam8157(at)gmail(dot)com> wrote:
> The fix is to not report progress for the TOAST index build, because it
> is an internal index, not a user CREATE INDEX. The patch also adds an
> isolation test that pauses CLUSTER at the start of the heap scan and
> checks that index_rebuild_count is 0.

Thanks for the patch!

I think the approach in the patch, i.e., passing INDEX_CREATE_SUPPRESS_PROGRESS
to suppress progress reporting when creating TOAST indexes, looks good.
But, adding that test seems overkill to me. I'd prefer to simplify the patch
as in the attached 0001 patch. Thoughts?

While working on this patch, I also found a related but separate issue:
during REPACK (CONCURRENTLY), index_rebuild_count in
pg_stat_progress_repack and pg_stat_progress_cluster did not advance
as indexes were rebuilt. The attached 0002 patch fixes this issue.

Regards,

--
Fujii Masao

Attachment Content-Type Size
v2-0001-Suppress-progress-reporting-when-creating-TOAST-i.patch application/octet-stream 1.9 KB
v2-0002-Fix-index-rebuild-progress-reporting-for-REPACK-C.patch application/octet-stream 1.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2026-09-09 11:39:53 Re: Concurrent DROP TABLESPACE can miss a shared dependency
Previous Message Greg Burd 2026-09-09 11:14:01 Re: Speed up COPY FROM text/CSV parsing using SIMD