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

From: Alvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Antonin Houska <ah(at)cybertec(dot)at>
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 10:27:21
Message-ID: asSyf0JWgPel8oNk@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2026-Oct-06, Antonin Houska wrote:

> 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.

True. I do want to clarify that the amount of memory used is not the
size of the tuples, though.

> 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.

Hmm, I'll see what I can come up with. Note you say "it might hold the
xmin horizon like any other long-running transactions", but that's not
true for VACUUM, so I think it's worth pointing it out explicitly, since
it's a clear disadvantage of REPACK.

> The paragraph about REPACK vs VACUUM LGTM.

Great, thanks for looking.

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"Tiene valor aquel que admite que es un cobarde" (Fernandel)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alena Rybakina 2026-10-06 10:34:32 Re: Vacuum statistics
Previous Message Ashutosh Sharma 2026-10-06 10:16:24 Re: Persist slot invalidations before publishing them