Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZDVYT-0007nS-Q7 for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jul 2015 10:29:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZDVYT-00063m-B6 for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jul 2015 10:29:17 +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) (envelope-from ) id 1ZDVYR-00063X-Uj for pgsql-hackers@postgresql.org; Fri, 10 Jul 2015 10:29:16 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZDVYP-0006cy-Hx for pgsql-hackers@postgresql.org; Fri, 10 Jul 2015 10:29:15 +0000 Received: from intern.anarazel.de (unknown [88.128.80.244]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 9167A860002; Fri, 10 Jul 2015 12:29:12 +0200 (CEST) Date: Fri, 10 Jul 2015 12:29:02 +0200 From: Andres Freund To: Fujii Masao Cc: Tom Lane , Martijn van Oosterhout , PostgreSQL-development Subject: Re: WAL logging problem in 9.4.3? Message-ID: <20150710102902.GL340@alap3.anarazel.de> References: <20150703164931.GI3291@awork2.anarazel.de> <20150703170229.GJ3291@awork2.anarazel.de> <20150703172605.GM3291@awork2.anarazel.de> <27532.1436195680@sss.pgh.pa.us> <20150706152123.GK8902@alap3.anarazel.de> <28415.1436197794@sss.pgh.pa.us> <22784.1436462863@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -4.8 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 2015-07-10 19:23:28 +0900, Fujii Masao wrote: > Maybe I'm missing something. But I start wondering why TRUNCATE > and INSERT (or even all the operations on the table created at > the current transaction) need to be WAL-logged while COPY can be > optimized. If no WAL records are generated on that table, the problem > we're talking about seems not to occur. Also this seems safe and > doesn't degrade the performance of data loading. Thought? Skipping WAL logging means that you need to scan through the whole shrared buffers to write out dirty buffers and fsync the segments. A single insert wal record is a couple orders of magnitudes cheaper than that. Essentially doing this juts for COPY is a heuristic. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers