agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Fujii Masao <masao.fujii@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Martijn van Oosterhout <kleptog@svana.org>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: WAL logging problem in 9.4.3?
Date: Fri, 10 Jul 2015 12:29:02 +0200
Message-ID: <20150710102902.GL340@alap3.anarazel.de> (raw)
In-Reply-To: <CAHGQGwEuT9p0KzZ=sbo1QJUo6-a-RgaTvpiCNBgZ0cKN9Gk7mQ@mail.gmail.com>
References: <20150703164931.GI3291@awork2.anarazel.de>
	<20150703170229.GJ3291@awork2.anarazel.de>
	<20150703172605.GM3291@awork2.anarazel.de>
	<CAHGQGwGGM2OBh4WOTd8wWqxKzRy+WdJX+-fxxPCWNz4eeJ1aQQ@mail.gmail.com>
	<27532.1436195680@sss.pgh.pa.us>
	<20150706152123.GK8902@alap3.anarazel.de>
	<28415.1436197794@sss.pgh.pa.us>
	<CAHGQGwHGMeqA7PbRj9e-cgA7-Sy09c+Ysyy=6Ts=vLOynpU2Hg@mail.gmail.com>
	<22784.1436462863@sss.pgh.pa.us>
	<CAHGQGwEuT9p0KzZ=sbo1QJUo6-a-RgaTvpiCNBgZ0cKN9Gk7mQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

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



view thread (244+ messages)  latest in thread

Message-ID: <20150710102902.GL340@alap3.anarazel.de>
Permalink:  ../20150710102902.GL340@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20150710102902.GL340@alap3.anarazel.de

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: andres@anarazel.de, masao.fujii@gmail.com, tgl@sss.pgh.pa.us, kleptog@svana.org
  Subject: Re: WAL logging problem in 9.4.3?
  In-Reply-To: <20150710102902.GL340@alap3.anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox