pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steve Singer <ssinger@ca.afilias.info>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL-development Hackers <pgsql-hackers@postgresql.org>
Subject: Re: skip WAL on COPY patch
Date: Tue, 23 Aug 2011 16:40:43 -0400
Message-ID: <4E54104B.107@ca.afilias.info> (raw)
In-Reply-To: <3073.1314130656@sss.pgh.pa.us>
References: <4E53E7D5.6030808@ca.afilias.info>
	<1739.1314126320@sss.pgh.pa.us>
	<CA+TgmoZj_kYAGJvfU0Y6tr2AUSipHQeSsr9pEPS_o5-CmjBLkw@mail.gmail.com>
	<3073.1314130656@sss.pgh.pa.us>

On 11-08-23 04:17 PM, Tom Lane wrote:
> Robert Haas<robertmhaas@gmail.com>  writes:
>> What I think would be really interesting is a way to make this work
>> when the table *isn't* empty.  In other words, have a COPY option that
>> (1) takes an exclusive lock on the table, (2) writes the data being
>> inserted into new pages beyond the old EOF, and (3) arranges for crash
>> recovery or transaction abort to truncate the table back to its
>> previous length.  Then you could do fast bulk loads even into a table
>> that's already populated, so long as you don't mind that the table
>> will be excusive-locked and freespace within existing heap pages won't
>> be reused.
>
> What are you going to do with the table's indexes?
>
> 			regards, tom lane
>

What about not updating the indexes during the copy operation then to an 
automatic rebuild of the indexes after the copy (but during the same 
transaction).  If your only adding a few rows to a large table this 
wouldn't be what you want, but if your only adding a few rows then a 
small amount of WAL isn't a big concern either.





view thread (10+ messages)  latest in thread

Message-ID: <4E54104B.107@ca.afilias.info>
Permalink:  ../4E54104B.107@ca.afilias.info/
Also on:    postgresql.org/message-id/4E54104B.107@ca.afilias.info

 · 

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: ssinger@ca.afilias.info, tgl@sss.pgh.pa.us, robertmhaas@gmail.com
  Subject: Re: skip WAL on COPY patch
  In-Reply-To: <4E54104B.107@ca.afilias.info>

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

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