From: Michael Paquier <michael@paquier.xyz>
To: Fujii Masao <fujii@postgresql.org>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Make DROP DATABASE command generate less WAL records.
Date: Thu, 21 Nov 2019 21:17:40 +0900
Message-ID: <20191121121740.GA1651@paquier.xyz> (raw)
In-Reply-To: <E1iXlJW-00040N-Bo@gemulon.postgresql.org>
References: <E1iXlJW-00040N-Bo@gemulon.postgresql.org>
On Thu, Nov 21, 2019 at 12:11:58PM +0000, Fujii Masao wrote:
> Make DROP DATABASE command generate less WAL records.
>
> Previously DROP DATABASE generated as many XLOG_DBASE_DROP WAL records
> as the number of tablespaces that the database to drop uses. This caused
> the scans of shared_buffers as many times as the number of the tablespaces
> during recovery because WAL replay of one XLOG_DBASE_DROP record needs
> that full scan. This could make the recovery time longer especially
> when shared_buffers is large.
>
> This commit changes DROP DATABASE so that it generates only one
> XLOG_DBASE_DROP record, and registers the information of all the tablespaces
> into it. Then, WAL replay of XLOG_DBASE_DROP record needs full scan of
> shared_buffers only once, and which may improve the recovery performance.
Fujii-san, you have forgotten to bump XLOG_PAGE_MAGIC in
xlog_internal.h?
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz, fujii@postgresql.org
Subject: Re: pgsql: Make DROP DATABASE command generate less WAL records.
In-Reply-To: <20191121121740.GA1651@paquier.xyz>
References: <E1iXlJW-00040N-Bo@gemulon.postgresql.org> <20191121121740.GA1651@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox