From: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
---|---|
To: | Michael Paquier <michael(at)paquier(dot)xyz> |
Cc: | Fujii Masao <fujii(at)postgresql(dot)org>, pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | Re: pgsql: Make DROP DATABASE command generate less WAL records. |
Date: | 2019-11-21 13:03:27 |
Message-ID: | CAHGQGwEm-f7rh2ZzQBdgfhQ_wNRZXprzR0A7EoK7WY7ZOta_fA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
On Thu, Nov 21, 2019 at 9:17 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> 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?
Thanks for pointing out that! Since the format of XLOG_DBASE_DROP WAL
record was changed, XLOG_PAGE_MAGIC must be bumped. Will do that.
Regards,
--
Fujii Masao
From | Date | Subject | |
---|---|---|---|
Next Message | Fujii Masao | 2019-11-21 13:20:24 | pgsql: Bump WAL version. |
Previous Message | Michael Paquier | 2019-11-21 12:17:40 | Re: pgsql: Make DROP DATABASE command generate less WAL records. |