Re: skip WAL on COPY patch

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: skip WAL on COPY patch
Date: 2011-08-25 02:45:18
Message-ID: CA+TgmoZ6zEDoST7MDdLkQ4QtsB+dyYNuKcpEtjVKLz=wQLm9Rw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 23, 2011 at 4:51 PM, Alvaro Herrera
<alvherre(at)commandprompt(dot)com> wrote:
> Excerpts from Robert Haas's message of mar ago 23 17:43:13 -0300 2011:
>> On Tue, Aug 23, 2011 at 4:17 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> > Robert Haas <robertmhaas(at)gmail(dot)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?
>>
>> Oh, hmm.  That's awkward.
>
> If you see what I proposed, it's simple: you can scan the new segment(s)
> and index the tuples found there (maybe in bulk which would be even
> faster).

You can do that much even if you just append to the file - you don't
need variable-length segments to make that part work.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-08-25 02:59:14 Re: cheaper snapshots redux
Previous Message Andrew Dunstan 2011-08-25 01:46:13 Re: pg_restore --no-post-data and --post-data-only