Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXlPZ-0006ow-5N for pgsql-committers@arkaria.postgresql.org; Thu, 21 Nov 2019 12:18:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iXlPX-0007W6-KX for pgsql-committers@arkaria.postgresql.org; Thu, 21 Nov 2019 12:18:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXlPV-0007Vz-Rr for pgsql-committers@lists.postgresql.org; Thu, 21 Nov 2019 12:18:11 +0000 Received: from [66.111.4.29] (helo=out5-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXlPT-0001Op-Cy for pgsql-committers@lists.postgresql.org; Thu, 21 Nov 2019 12:18:09 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2F94A223D7; Thu, 21 Nov 2019 07:17:46 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 21 Nov 2019 07:17:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=rWSHe80yMvzNrEmsFNDC3IhRInS NJWA7xKFVfm/JuFA=; b=U4SCT2928TfeIqIdJZRY7MRjT2XrXWv9tMg33PN4Gqd pyc4p9gMpCRSxkzkTUCB//X95wUJwfiIjtN0qSmbObtkwNiMSWZXGpVmhH/fvzPS bca1beTCWsXfe/WqwFtPx0dgmr5976u9IJIrSrkV9iaH64PUjvICJQS6FY9e7pAW H6d/1KG34ZQawqWmbEEaGOPENM82N8e5778XQBbDNc69R3XeiyXgaGmYeJVKKn/X hAd5+6Me/9aliJEjTOLJNepeuUHeXlqQI2bdQ4kx3qrSPUyxihNbfi5ELssk1/W9 DubwisO/1wnX/AY5kPQ3agxTtFsKtB/DTOmsheowH3Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=rWSHe8 0yMvzNrEmsFNDC3IhRInSNJWA7xKFVfm/JuFA=; b=hSnxvVugCRqd1d6k0MOiC7 Lqdd75kQS0SFCxncf4VdeHNVr24fZ79eRLxiWIuWXxQ5276BkO9CQ6va11MDmK2W T6cLXe2JGKciAMZX5dpCqtCoSH4l1UCh3EqD///mZ6r7i8enF+vk4OUwTmixb3dg bqk8geSbUIIw5jhjndWE4kgpIoGvJxVvssea1AcOUALm2fF/hfQPCSGXoegMjiKG +FKmndaLvDmyAZhm0YfYJWOHG0Ca5sF1efvSD7gj4GNqqnB3kS1ZFHGJ6zSj4QDh nIqoB/XQJiMKGQZXMZKRBwG+5XZ6vBiDRwImAQKkXuVo/iC0sFErvr6mHiS8JYUg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudehvddggedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucfkphepudduuddruddtvddrudektddrudekheenucfrrghr rghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiienucevlh hushhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id F2978306005C; Thu, 21 Nov 2019 07:17:44 -0500 (EST) Date: Thu, 21 Nov 2019 21:17:40 +0900 From: Michael Paquier To: Fujii Masao Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Make DROP DATABASE command generate less WAL records. Message-ID: <20191121121740.GA1651@paquier.xyz> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SLDf9lqlvOQaIe6s" Content-Disposition: inline In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.29 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 21, 2019 at 12:11:58PM +0000, Fujii Masao wrote: > Make DROP DATABASE command generate less WAL records. >=20 > 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. >=20 > This commit changes DROP DATABASE so that it generates only one > XLOG_DBASE_DROP record, and registers the information of all the tablespa= ces > 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 --SLDf9lqlvOQaIe6s Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl3WgGQACgkQnvQgOdby QH0r5A//YShdgrWqHDL+qqhDk7vHoygbO4wLnG0RyQTSiDfMnBAazyQy+Mg0S05z V3pm2R9z8X3OitPUdjFcrL4wPbSIiqknJ8uJv9QOYfrNSnyQhGRH0CDJ0SE4bajz yQqif3VsDr6vi6zWZ4B+MK0sWHB7BJosf6BaaWu3oS3kJGKZ/KgLZ7Nv1pTX3DRz 3/PoZZ6pBhXTBWyGbpg7KdGNXimojbtLFSzg0aq3uVa+3LxDPPo9pKOdXdcR9sLl SVE1m4dlgcQDdosL+9RTlXLyYiuaHtREmGjcysWa6IpELLHfxg/2QFcuCU9tLn3D YymAa/syVa2AksxSQNpR1+ZUeWzCgMB2kAiYQM74R2bRnJic+hMOZ9LaCJWhvuF9 ARvZCPdj4Ud5vibj53EPiFMR/lmwex3zu1yDLRhwYnwai8V+C0tGHjXVAwP0O3wZ L2FUZ3B+0kOXf9UGIpw+Z17ZsPLPT4JC67TzyuoYu24B/RP21DbWQQImPpvjB4ap Qmo0sXlx4bEHaoaZttepd44ZAHeCC/8N3Hdjtxh0SxkykjhmdWV2ujbdC6P6oOEd Ln5m5xlbV+vkt+fxaZVRMLeNfxonnGfN5MCn4Y1ekd4cIJc2eqCa1nu3jc6e67H6 R+CCM/xcnrGadDvM1AjKOqD2bf5f9BFwpV1ihIl7YrNEgXgP4fA= =+wQi -----END PGP SIGNATURE----- --SLDf9lqlvOQaIe6s--