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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: O(n^2) system calls in RemoveOldXlogFiles()
Date: 2021-01-13 07:40:16
Message-ID: X/6j4E71mBxGnAYE@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hou, Zhijie 2021-01-13 08:00:07 RE: Single transaction in the tablesync worker?
Previous Message kuroda.hayato@fujitsu.com 2021-01-13 07:39:38 RE: ResourceOwner refactoring