Re: REPACK (CONCURRENTLY) can't complete after ~105M concurrent updates/deletes

From: Antonin Houska <ah(at)cybertec(dot)at>
To: alvherre(at)kurilemu(dot)de
Cc: shihao zhong <zhong950419(at)gmail(dot)com>, Radim Marek <radim(at)boringsql(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: REPACK (CONCURRENTLY) can't complete after ~105M concurrent updates/deletes
Date: 2026-10-06 08:20:55
Message-ID: 13474.1791274855@localhost
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Álvaro Herrera <alvherre(at)kurilemu(dot)de> wrote:

> On 2026-Sep-27, shihao zhong wrote:
>
> > Here is a try with Fable, as v2 of Radim's patch.
> >
> > It adds a paragraph to Notes. REPACK is for bloat and clustering. For
> > wraparound uses VACUUM, because REPACK takes much longer and can fail
> > late.
>
> Yeah, that sounds appropriate.
>
> I think the original <note> paragraph is worth rewriting more deeply
> though rather than just adding one more paragraph; I think some of the
> things it mentions are not so relevant from the user's POV, and also I
> think we can use some small changes elsewhere in the page.
>
> What do you think of the attached? I used -U7 in `git format-patch` so
> that the surrounding can be read directly from the patch.

I thought about this documentation update last week and wasn't sure it needs
to be that exact about how much memory is consumed per changed tuple. I think
we should rather encourage users to do monitoring in genaral: besides memory,
the system can run out of disk space (REPACK w/o CONCURRENTLY also creates a
copy of the table, but it's probably not used for big tables due to the
stronger lock). Besides that, REPACK runs in a single transaction, so it might
hold the xmin horizon(s) for too long (like any other long-running
transactions). Finally, the processing of the concurrent changes might not be
fast enough, in which case the AccessExclusiveLock may be needed for
surprisingly long time.

The paragraph about REPACK vs VACUUM LGTM.

--
Antonin Houska
Web: https://www.cybertec-postgresql.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Haruna Miwa 2026-10-06 08:30:25 Re: [PATCH] psql: avoid CREATE command completion after GRANT/REVOKE CREATE
Previous Message Fujii Masao 2026-10-06 07:52:34 Re: create table like including storage parameter