Re: OID suppression issues

From: Manfred Koizar <mkoi-pg(at)aon(dot)at>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: OID suppression issues
Date: 2002-07-17 08:35:25
Message-ID: hk8ajusd6d1td7ofterrecmm64pc7ebgod@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 16 Jul 2002 12:23:01 -0400, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
wrote:
>I've been thinking that it's really not a good idea to make the OID
>field optional without any indication in the tuple header whether it
>is present. In particular, this will make life difficult for tools
>like pg_filedump that try to display tuple headers without any outside
>information. I think it'd be a good idea to expend a bit in t_infomask
>to show whether an OID field is allocated or not.

If we want, we can get along without using a bit. On machines with 4
byte alignment the presence of an oid can be deduced from the tuple
header length, t_hoff. The "Optional Oid" patch defines a macro
HeapTupleHeaderExpectedLen in htup.h. This macro is currently only
used for debugging; we could expose this or a similar macro or
function to tools.

A little problem arises with 8 byte alignment: due to padding tuple
headers with or without oid might have the same length. If padding
bytes are properly set to 0, those tools would display "Invalid Oid"
instead of "No Oid".

>We currently have two free bits in t_infomask, which is starting to get
>a bit tight, but offhand I do not see anything else coming down the pike
>that would need another bit. Also, we could consider expanding
>t_infomask to three bytes if we had to.

... and if we are really miserly, we use those two or three bits in
t_hoff, which are always 0 because t_hoff = MAXALIGN(...).

I'm not strongly biased towards either direction. If we end up using
a bit in t_infomask, I'll change the announcement to "This patch
reduces per tuple overhead by 31 bits ..."

I've finished the patch yesterday and have posted it to -patches this
morning. Please have a look at it.

Servus
Manfred

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-07-17 08:36:15 ELOGs doubled up
Previous Message Hiroshi Inoue 2002-07-17 08:24:53 Re: DROP COLUMN