COPY with no WAL, in certain circumstances

From: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
To: <pgsql-patches(at)postgresql(dot)org>
Subject: COPY with no WAL, in certain circumstances
Date: 2007-01-05 19:21:19
Message-ID: 1168024879.3655.45.camel@silverbirch.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

http://archives.postgresql.org/pgsql-hackers/2006-10/msg01172.php

As discussed on -hackers, its possible to avoid writing any WAL at all
for COPY in these circumstances:

BEGIN;
CREATE TABLE foo..
COPY foo...
COMMIT;

BEGIN;
TRUNCATE foo..
COPY foo...
COMMIT;

The enclosed patch implements this, as discussed. There is no user
interface to enable/disable, just as with CTAS and CREATE INDEX; no
docs, just code comments.

This plays nicely with the --single-transaction option in psql to allow
fast restores/upgrades.

YMMV but disk bound COPY will benefit greatly from this patch, some
tests showing 100% gain. COPY is still *very* CPU intensive, so some
tests have shown negligible benefit, fyi, but that isn't the typical
case.

Applies cleanly to CVS HEAD, passes make check.

--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com

Attachment Content-Type Size
copy_nowal.v1.patch text/x-patch 24.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gurjeet Singh 2007-01-05 19:28:07 Re: A patch to pg_regress for Windows port
Previous Message Gurjeet Singh 2007-01-05 19:18:47 A patch to pg_regress for Windows port

Browse pgsql-patches by date

  From Date Subject
Next Message Gurjeet Singh 2007-01-05 19:28:07 Re: A patch to pg_regress for Windows port
Previous Message Gurjeet Singh 2007-01-05 19:18:47 A patch to pg_regress for Windows port