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 20050901134540.GC28356@surnet.cl
Whole thread Raw
In response to Re: Remove xmin and cmin from frozen tuples  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Remove xmin and cmin from frozen tuples
Re: Remove xmin and cmin from frozen tuples
List pgsql-hackers
On Wed, Aug 31, 2005 at 09:14:42PM -0700, Josh Berkus wrote:

> > One thing that comes to mind is that this makes somewhat easier to build
> > a tool to write pre-built tables, for bulk-loading purposes.  You just
> > construct the binary file with the HEAP_FROZEN bit set, and then attach
> > the file to a dummy table.  (Then again, you can do it today, using a
> > Xmin of FrozenTransactionId.  I wonder why the Bizgres people isn't
> > advocating a tool to do that.  It is very hard to do with user-defined
> > types, but for BI/DW you mostly don't need those, do you?)
> 
> Hmmm ... can you expand on this a little?  We'd discussed "frozen partitions" 
> but hadn't thought to get around to them for a while, expecting the kind of 
> issues which Tom just raised.

What issues did he raise on this?

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.

Note that this is a very different business from skipping the Xmin and
Cmin from the tuple header -- in fact, there's no relation to that at
all.

-- 
Alvaro Herrera -- Valdivia, Chile         Architect, www.EnterpriseDB.com
FOO MANE PADME HUM


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Minimally avoiding Transaction Wraparound in VLDBs
Next
From: "Sergey E. Koposov"
Date:
Subject: 8.1beta, Subtle bug in COPY in Solaris systems