Optional Oid

Started by Manfred Koizarabout 24 years ago4 messagespatches
Jump to latest
#1Manfred Koizar
mkoi-pg@aon.at

Here is a preview of a patch which shall eventually further reduce
heap tuple header size by four bytes for tables created WITHOUT OIDS.

t_oid is eliminated from the start of struct HeapTupleHeader. If an
oid is needed, it is added at the end of the struct (after the null
bitmap, if present).

Per Tom Lane's suggestion the information whether a tuple has an oid
or not is carried in the tuple descriptor. For debugging reasons
tdhasoid is of type char, not bool. There are predefined values for
WITHOID, WITHOUTOID and UNDEFOID.

This patch has been generated against a cvs snapshot from last week
and I don't expect it to apply cleanly to current sources. While I
post it here for public review, I'm working on a new version against a
current snapshot. (There's been heavy activity recently; hope to
catch up some day ...)

This is a long patch; if it is too hard to swallow, I can provide it
in smaller pieces:

Part 1: Accessor macros
Part 2: tdhasoid in TupDesc
Part 3: Regression test
Part 4: Parameter withoid to heap_addheader
Part 5: Eliminate t_oid from HeapTupleHeader

Part 2 is the most hairy part because of changes in the executor and
even in the parser; the other parts are straightforward.

Up to part 4 the patched postmaster stays binary compatible to
databases created with an unpatched version. Part 5 is small (100
lines) and finally breaks compatibility.

[Follow-up to -hackers?]

Servus
Manfred

#2Manfred Koizar
mkoi-pg@aon.at
In reply to: Manfred Koizar (#1)
Re: Optional Oid

On Wed, 17 Jul 2002 09:47:37 +0200, I wrote:

I'm working on a new version against a current snapshot.

Here it is.

This is a long patch; if it is too hard to swallow, I can provide it
in smaller pieces:

Part 1: Accessor macros
Part 2: tdhasoid in TupDesc
Part 3: Regression test
Part 4: Parameter withoid to heap_addheader
Part 5: Eliminate t_oid from HeapTupleHeader

This time I do it the other way round: Here are the five smaller
parts. An all-in-one patch will follow, if requested.

Servus
Manfred

Attachments:

09a.1-Accessor.difftext/plain; charset=us-ascii; name=09a.1-Accessor.diffDownload+193-112
09a.2-TupDesc.difftext/plain; charset=us-ascii; name=09a.2-TupDesc.diffDownload+146-30
09a.3-OidTest.difftext/plain; charset=us-ascii; name=09a.3-OidTest.diffDownload+76-0
09a.4-OidAddheader.difftext/plain; charset=us-ascii; name=09a.4-OidAddheader.diffDownload+13-2
09a.5-WithoutOid.difftext/plain; charset=us-ascii; name=09a.5-WithoutOid.diffDownload+18-14
#3Bruce Momjian
bruce@momjian.us
In reply to: Manfred Koizar (#2)
Re: Optional Oid

Your patch has been added to the PostgreSQL unapplied patches list at:

http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------

Manfred Koizar wrote:

On Wed, 17 Jul 2002 09:47:37 +0200, I wrote:

I'm working on a new version against a current snapshot.

Here it is.

This is a long patch; if it is too hard to swallow, I can provide it
in smaller pieces:

Part 1: Accessor macros
Part 2: tdhasoid in TupDesc
Part 3: Regression test
Part 4: Parameter withoid to heap_addheader
Part 5: Eliminate t_oid from HeapTupleHeader

This time I do it the other way round: Here are the five smaller
parts. An all-in-one patch will follow, if requested.

Servus
Manfred

[ Attachment, skipping... ]

[ Attachment, skipping... ]

[ Attachment, skipping... ]

[ Attachment, skipping... ]

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#4Bruce Momjian
bruce@momjian.us
In reply to: Manfred Koizar (#1)
Re: Optional Oid

New version applied.

---------------------------------------------------------------------------

Manfred Koizar wrote:

Here is a preview of a patch which shall eventually further reduce
heap tuple header size by four bytes for tables created WITHOUT OIDS.

t_oid is eliminated from the start of struct HeapTupleHeader. If an
oid is needed, it is added at the end of the struct (after the null
bitmap, if present).

Per Tom Lane's suggestion the information whether a tuple has an oid
or not is carried in the tuple descriptor. For debugging reasons
tdhasoid is of type char, not bool. There are predefined values for
WITHOID, WITHOUTOID and UNDEFOID.

This patch has been generated against a cvs snapshot from last week
and I don't expect it to apply cleanly to current sources. While I
post it here for public review, I'm working on a new version against a
current snapshot. (There's been heavy activity recently; hope to
catch up some day ...)

This is a long patch; if it is too hard to swallow, I can provide it
in smaller pieces:

Part 1: Accessor macros
Part 2: tdhasoid in TupDesc
Part 3: Regression test
Part 4: Parameter withoid to heap_addheader
Part 5: Eliminate t_oid from HeapTupleHeader

Part 2 is the most hairy part because of changes in the executor and
even in the parser; the other parts are straightforward.

Up to part 4 the patched postmaster stays binary compatible to
databases created with an unpatched version. Part 5 is small (100
lines) and finally breaks compatibility.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026