Re: Recovery performance of DROP DATABASE with many tablespaces - Mailing list pgsql-hackers

From Ashwin Agrawal
Subject Re: Recovery performance of DROP DATABASE with many tablespaces
Date
Msg-id CALfoeivwYPNOYYayiXLiOSxwFr8-5YM8RMwwG4Hkjdf7PJCdkg@mail.gmail.com
Whole thread Raw
In response to Recovery performance of DROP DATABASE with many tablespaces  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers

On Mon, Jun 4, 2018 at 9:46 AM, Fujii Masao <masao.fujii@gmail.com> wrote:
Generally the recovery performance of DROP DATABASE is not critical
for many users. But unfortunately my colleague's project might need to
sometimes drop the database using multiple tablespaces, for some reasons.
So, if the fix is not so complicated, I think that it's worth applying that.

Agree, in isolation need for this improvement is not felt, but yes any improvements for single serialized replay process is definitely helpful.


The straight approach to avoid such unnecessary scans is to change
DROP DATABASE so that it generates only one XLOG_DBASE_DROP record,
and register the information of all the tablespace into it. Then, WAL replay
of XLOG_DBASE_DROP record scans shared_buffers once and deletes
all tablespaces. POC patch is attached.

Also, irrespective of performance improvement looks better to just have single xlog record for the same.

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [PATCH] Trim trailing whitespace in vim and emacs
Next
From: Andres Freund
Date:
Subject: Why is fncollation in FunctionCallInfoData rather than fmgr_info?