Re: O(n^2) system calls in RemoveOldXlogFiles()

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Andres Freund <andres@anarazel.de>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2021-01-12T07:27:40Z
Lists: pgsql-hackers
On Tue, Jan 12, 2021 at 07:15:21PM +1300, Thomas Munro wrote:
> Hah, I even knew that, apparently, but forgot.  Adding Michael who
> wrote a patch.  It'd be nice to fix this, at least in 14.

Yeah, this rings a bell.  I never went back to it even if the thing
looks rather clean at quick glance (not tested), but I may be able
to spend some cycles on that.  I don't think that's critical enough
for a backpatch, so doing something only on HEAD is fine by me.
What's your take?
--
Michael

Commits

  1. Fix O(N^2) stat() calls when recycling WAL segments