Re: O(n^2) system calls in RemoveOldXlogFiles() - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: O(n^2) system calls in RemoveOldXlogFiles()
Date
Msg-id X/6j4E71mBxGnAYE@paquier.xyz
Whole thread Raw
In response to Re: O(n^2) system calls in RemoveOldXlogFiles()  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
On Tue, Jan 12, 2021 at 12:10:24PM -0300, Alvaro Herrera wrote:
> Apparently b2a5545bd63f changed; before that commit, that code
> (including the quoted comment) was all in RemoveOldXlogFiles, and
> endlogSegNo was calculated only once.  But ISTM that even with that
> formulation it had the problem you point out.  The real problem is the
> loop hidden inside InstallXLogFileSegment().

I am not sure to get your point here.  The purposes of the two
incrementations in InstallXLogFileSegment() and RemoveXlogFile() are
different, still the former incrementation makes the recycling done by
the latter faster,
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: "kuroda.hayato@fujitsu.com"
Date:
Subject: RE: ResourceOwner refactoring
Next
From: "Hou, Zhijie"
Date:
Subject: RE: Single transaction in the tablesync worker?