Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 1B5BDB5DC01 for ; Tue, 20 Sep 2011 02:05:11 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 00174-02 for ; Tue, 20 Sep 2011 05:05:02 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.216.181]) by mail.postgresql.org (Postfix) with ESMTP id C450DB5DC0C for ; Tue, 20 Sep 2011 02:05:01 -0300 (ADT) Received: by qyk7 with SMTP id 7so146225qyk.19 for ; Mon, 19 Sep 2011 22:05:01 -0700 (PDT) Received: by 10.229.66.158 with SMTP id n30mr240037qci.249.1316495101081; Mon, 19 Sep 2011 22:05:01 -0700 (PDT) Received: from ayaki.localdomain (124-148-242-247.dyn.iinet.net.au. [124.148.242.247]) by mx.google.com with ESMTPS id j15sm398684qaq.21.2011.09.19.22.04.58 (version=SSLv3 cipher=OTHER); Mon, 19 Sep 2011 22:05:00 -0700 (PDT) Message-ID: <4E781EF8.3000400@ringerc.id.au> Date: Tue, 20 Sep 2011 13:04:56 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 MIME-Version: 1.0 To: Jon Nelson CC: pgsql-performance@postgresql.org Subject: Re: Postgres INSERT performance and scalability References: <20110920005342.GO12765@tamriel.snowman.net> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201109/286 X-Sequence-Number: 45062 On 09/20/2011 09:21 AM, Jon Nelson wrote: > Isn't the WAL basically COW? Nope, it's a lot more like a filesystem journal - though it includes all data, not just metadata like filesystem journals usually do. Now, you could argue that PostgreSQL uses a copy-on-write like system to maintain row versions so that already-running statements (or SERIALIZABLE transactions) don't see data from the future and to maintain rollback data for uncommitted transactions. It's the *new* data that gets written to the WAL, though, not the old data. (OK, if you have full_page_writes enabled you might get a mix of old and new data written to WAL, but that's an implementation detail). -- Craig Ringer