Re: Remove xmin and cmin from frozen tuples - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Remove xmin and cmin from frozen tuples
Date
Msg-id 17726.1125692879@sss.pgh.pa.us
Whole thread Raw
In response to Re: Remove xmin and cmin from frozen tuples  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: Remove xmin and cmin from frozen tuples
Re: Remove xmin and cmin from frozen tuples
List pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> On Fri, Sep 02, 2005 at 04:02:08PM -0400, Tom Lane wrote:
>> It has to be a *new* table, not an *empty* table.  If it's already
>> visible to other xacts then somebody else could insert into it in
>> parallel with you, because COPY doesn't take an exclusive lock.

> What about the indexes?  Logging one of the inserters and not the other
> is certain to corrupt the whole thing.

Good point, but that fits in just fine with the restriction to
just-created tables.

>> Contrariwise, it doesn't really matter (I think) if there are WAL-logged
>> records already in the table and COPY is adding more that aren't logged.

> Only if the page is locked in a fashion that the bulk loader can't
> insert tuples into a page that the other transaction is using.

What other transaction?  The point I was making is thatBEGIN;CREATE TABLE ...INSERT ...COPY ...
is still optimizable.  There isn't going to be anyone competing with
the COPY while it runs.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Procedural language definitions (was Re: 8.1 and syntax checking at create time)
Next
From: Alvaro Herrera
Date:
Subject: Re: Remove xmin and cmin from frozen tuples