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 1f4BvR-0003ef-V4 for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Apr 2018 20:56:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f4BvQ-0000mY-KV for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Apr 2018 20:56:04 +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.89) (envelope-from ) id 1f4BvQ-0000mE-Dl for pgsql-hackers@lists.postgresql.org; Thu, 05 Apr 2018 20:56:04 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f4BvN-0000dC-4i for pgsql-hackers@postgresql.org; Thu, 05 Apr 2018 20:56:03 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 908F12089C; Thu, 5 Apr 2018 16:55:59 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Thu, 05 Apr 2018 16:55:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=lUiEC7 cVRn5hgX0zEGbJ8TVU1ZirhjZfgmJ8ieRMhgg=; b=ZAs8UXoxKXIt6ReaxQEq2H yOa0ffAL+rQ/4G/RLHbZ4PmRF2sbYM/5ythgUMlrPx9eMB6aTCxv+hJWfuo6gnH2 I6h0+kPP7vPzGtenaqDppFlKbTMkF74yhDzFidx2nkefkERMsJhuosVUjAkFjtIP 3F1VrI70GK1PG0YK1ysu8PeyG5fDaYy6nVWgk/8PjFP0gNoeQKxhgS/EX1GlXRl7 K6RVZ4UeVLbPLngqrStk5sLkf1c8ljSwsYkDi9P2sItMR+QcB/Gf9eBpLoOWupsv yJit8Hq7P2LJP9GOeq/RvSvCnqkRQow+7MVazcIZrWVxPIEcYtIAX5scJhc+myjg == 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 4C245E47F2; Thu, 5 Apr 2018 16:55:59 -0400 (EDT) Subject: Re: file cloning in pg_upgrade and CREATE DATABASE From: Peter Eisentraut To: Michael Paquier References: <20180319070636.GA4633@paquier.xyz> <20180319071415.GB4633@paquier.xyz> <20180320025849.GB4963@paquier.xyz> <678999c6-0967-d22a-e7d1-2a3aff83a77b@2ndquadrant.com> <20180322023831.GG2490@paquier.xyz> <9380bebc-3c16-42f0-d0e1-da7c235f8a58@2ndquadrant.com> <20180326061516.GC2759@paquier.xyz> Cc: pgsql-hackers Organization: 2ndQuadrant Message-ID: Date: Thu, 5 Apr 2018 16:55:58 -0400 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: Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I think we have raised a number of interesting issues here which require more deeper consideration. So I suggest to set this patch to Returned with feedback. Btw., I just learned that copy_file_range() only works on files on the same device. So more arrangements will need to be made for that. > I have run some more tests on both macOS and Linux with ext4, and my> results are that the bigger the flush distance, the better. Before we> made the adjustments for APFS, we had a flush size of 64kB, now it's 1MB> and 32MB on macOS. In my tests, I see 256MB as the best across both> platforms, and not flushing early at all is only minimally worse. Based on this, I suggest that we set the flush distance to 32MB on all platforms. Not only is it faster, it avoids having different settings on some platforms. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services