From: sawanoboly (@sawanoboly) <noreply+sawanoboly@github.com>
To: reorg/pg_repack <noreply+reorg-pg_repack@github.com>
Subject: Re: [reorg/pg_repack] issue #485: Consider an option to build indexes before copying data during table repack
Date: Fri, 21 Aug 2026 02:50:16 +0000
Message-ID: <gh-reorg-pg_repack-485-c5364594041@github.com> (raw)
In-Reply-To: <gh-reorg-pg_repack-485@github.com>
References: <gh-reorg-pg_repack-485@github.com>
@RonJohn2
I agree that this approach would be significantly slower, and I understand that this is an important trade-off.
In our environment, however, completing the repack is more important than minimizing the execution time. We have sufficient cluster storage, but the local storage available for temporary files is the limiting factor.
We also tried increasing `maintenance_work_mem` to 32 GB via `PGOPTIONS` and setting `max_parallel_maintenance_workers=0`. This reduced memory pressure, but the local storage was still gradually exhausted during the index build, eventually resulting in `No space left on device`.
We haven't tried `--jobs=1` yet, but I will also consider testing that. My main point is that an option to build the indexes before copying the data could provide a way to trade execution time for lower peak temporary storage usage.
For some environments, a much slower repack that completes successfully would be preferable to a faster repack that cannot complete due to temporary storage limitations.