Re: Speedup of relation deletes during recovery - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Speedup of relation deletes during recovery
Date
Msg-id 20180330024631.GF1368@paquier.xyz
Whole thread Raw
In response to Re: Speedup of relation deletes during recovery  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Responses Re: Speedup of relation deletes during recovery  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
On Fri, Mar 30, 2018 at 11:19:58AM +0900, Kyotaro HORIGUCHI wrote:
> At Fri, 30 Mar 2018 08:31:29 +0900, Fujii Masao <masao.fujii@gmail.com> wrote in
<CAHGQGwHVQkdfDqtvGVkty+19cQakAydXn1etGND3X0PHbZ3+6w@mail.gmail.com>
>> When multiple relations are deleted at the same transaction,
>> the files of those relations are deleted by one call to smgrdounlinkall(),
>> which leads to scan whole shared_buffers only one time. OTOH,
>> during recovery, smgrdounlink() (not smgrdounlinkall()) is called
>> for each file to delete, which leads to scan shared_buffers multiple times.
>> Obviously this can cause to increase the WAL replay time very much
>> especially when shared_buffers is huge.
>>
>> To alleviate this situation, I'd like to propose to change the recovery
>> so that it also calls smgrdounlinkall() only one time to delete multiple
>> relation files. Patch attached. Thought?
>
> It is obviously a left-over of 279628a0a7. This patch applies the
> same change with the patch and looks fine for me. Note that
> FinishPreparedTransaction has the same loop over smgrdounlink.

Yeah, I was just going to say the same after looking at Fujii-san's
patch.  This would also cause smgrdounlink() to become unused in the
core code.  So this could just be... Removed?

/me Preparing shelter against incoming wraith.

That's not v11 material at this point in any case.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: [HACKERS] A design for amcheck heapam verification
Next
From: Michael Paquier
Date:
Subject: Re: PATCH: Configurable file mode mask