Re: [HACKERS] Last thoughts about LONG

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: wieck(at)debis(dot)com (Jan Wieck)
Cc: pgman(at)candle(dot)pha(dot)pa(dot)us, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Last thoughts about LONG
Date: 1999-12-11 18:52:11
Message-ID: 24287.944938331@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

wieck(at)debis(dot)com (Jan Wieck) writes:
> Another bonus would be this: What happens on an UPDATE to a
> table having LONG attributes? If the attribute is not
> modified, the OLD LongData will be found in the targetlist,
> and we'll not waste any space by storing the same information
> again.

Won't work. If you do that, you have several generations of the
"primary" tuple pointing at the same item in the "secondary" table.
There is room in the multiple primary tuples to keep track of their
committed/uncommitted status, but there won't be enough room to
keep track in the secondary table.

I think this can only work if there are exactly as many generations
of the LONG chunks in the secondary table as there are of the primary
tuple in the main table, and all of them have the same transaction
identification info stored in them as the corresponding copies of
the primary tuple have.

Among other things, this means that an update or delete *must* scan
through the tuple, find all the LONG fields, and go over to the
secondary table to mark all the LONG chunks as deleted by the current
xact, just the same as the primary tuple gets marked. This puts a
considerable crimp in your claim that it'd be more efficient than
a multiple-tuple-segment approach.

Of course, this could be worked around if the secondary table did *not*
use standard access methods (it could be more like an index, and rely on
the primary table for all xact status info). But that makes it look
even less like a clean data-type-based solution...

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Morfeus 1999-12-11 18:53:19 Help
Previous Message Tom Lane 1999-12-11 18:32:46 Re: [HACKERS] LONG