Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eozge-0006TY-3i for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Feb 2018 22:50:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eozgb-0004wm-Kp for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Feb 2018 22:49:57 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eozgb-0004wb-4G for pgsql-hackers@lists.postgresql.org; Thu, 22 Feb 2018 22:49:57 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eozgW-0006fu-Uy for pgsql-hackers@postgresql.org; Thu, 22 Feb 2018 22:49:56 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 95E0A20A90; Thu, 22 Feb 2018 17:49:49 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute7.internal (MEProxy); Thu, 22 Feb 2018 17:49:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=EDucHQ aSWC234JeJeNnmiAgnEH0twYynz+9MKLhFPNg=; b=KZlYUz99EMGLb0K4va6tyD PDHjein4/Kt+wxT1PYAX1tNY8/tdPTzhqLnVvZhqvsczKSRk8JZAtMWN6b7/CfCs uYrsXm2cPQwIWmMB53t3WgbnSVlaZZ4xd+YpG7k8+3OQ/+XhaMPVb+Wu3Qlj3sN5 rSbyOWlj52P5aGjrnP4BaQ2gPlowhmHqGcft8wxJl8s3h2iP4U/e9gmyFfkOcb8k JQiHlbOjI4PunkDgppwiKmLLHpD1ra0PCSheY3g1cOH+MmujzkwD9Lrv1/T2fDua QackkmvsoJbY5AJbayUyqXJBqcrgMtdgsmTMHTXvoNDgYYCX9Tj7Zp4iKHgwuOvg == X-ME-Sender: Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id 525767E070; Thu, 22 Feb 2018 17:49:49 -0500 (EST) Subject: Re: file cloning in pg_upgrade and CREATE DATABASE To: Tomas Vondra , pgsql-hackers References: <63b71efe-71c3-5849-0780-6b5447f5c7b1@2ndquadrant.com> From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <9a3df7ee-6bc1-2ba6-7253-134e5bb9a943@2ndquadrant.com> Date: Thu, 22 Feb 2018 17:49:48 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <63b71efe-71c3-5849-0780-6b5447f5c7b1@2ndquadrant.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2/21/18 18:57, Tomas Vondra wrote: > Nice improvement, of course. How does that affect performance on the > cloned database? If I understand this correctly, it essentially enables > CoW on the files, so what's the overhead on that? It'd be unfortunate to > speed up CREATE DATABASE only to get degraded performance later. I ran a little test (on APFS and XFS): Create a large (unlogged) table, copy the database, then delete everything from the table in the copy. That should need to CoW all the blocks. It has about the same performance with cloning, possibly slightly faster. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services