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

From Alvaro Herrera
Subject Re: Remove xmin and cmin from frozen tuples
Date
Msg-id 20050901155610.GA29642@surnet.cl
Whole thread Raw
In response to Re: Remove xmin and cmin from frozen tuples  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, Sep 01, 2005 at 11:08:36AM -0400, Tom Lane wrote:
> Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> > What I'm saying is that you can write a heap file, on which the tuples
> > would all have xmin=FrozenTransactionId, xmax=Invalid, and the
> > corresponding bits set in the infomask.  This ensures that no matter the
> > state of the server, you can plug the file in and all tuples will be
> > valid.
> 
> > The "only" problem is figuring out how to lay the data in the tuples
> > themselves, w.r.t endianness and such.  This is platform-dependent, so
> > you have to write code to do it correctly.  In absence of user-defined
> > types, this should not be _too_ hard to do.  Of course, such a program
> > would in general also be Postgres-version-dependent.
> 
> Of course, it's fair to ask whether such a program would be any faster
> than binary-mode COPY by the time you got done ... or enough faster to
> justify your effort, anyway.

It may not be faster generating the data in the first place, but you
don't have to vacuum the table, nor you are subject to hint bits
changing, resulting in more unnecessary I/O.

This can't be avoided with COPY, because there's always the chance that
it will fail partway through, so you can't write frozen tuples.  With an
external program, you can just dump the invalid line somewhere else and
continue with the rest.

-- 
Alvaro Herrera -- Valdivia, Chile         Architect, www.EnterpriseDB.com
"Just treat us the way you want to be treated + some extra allowancefor ignorance."
(MichaelBrusser)
 


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Using multi-locale support in glibc
Next
From: Simon Riggs
Date:
Subject: Re: Minimally avoiding Transaction Wraparound in VLDBs