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

From Jerry Sievers
Subject Re: Speedup of relation deletes during recovery
Date
Msg-id 877eptjw48.fsf@jsievers.enova.com
Whole thread Raw
In response to Speedup of relation deletes during recovery  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
Fujii Masao <masao.fujii@gmail.com> writes:

> Hi,
>
> 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.

Forgot to mention version in my TLDR prev reply :-)

                                                                    version
                       
 

------------------------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 9.5.12 on x86_64-pc-linux-gnu (Ubuntu 9.5.12-1.pgdg16.04+1), compiled by gcc (Ubuntu
5.4.0-6ubuntu1~16.04.9)5.4.0 20160609, 64-bit
 
(1 row)


>
> 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?
>
> Regards,

-- 
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net
p: 312.241.7800


pgsql-hackers by date:

Previous
From: Jerry Sievers
Date:
Subject: Re: Speedup of relation deletes during recovery
Next
From: Bruce Momjian
Date:
Subject: lo_import() of an empty file