Re: Another idea for dealing with cmin/cmax

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org, jim(at)nasby(dot)net, tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: heikki(at)enterprisedb(dot)com
Subject: Re: Another idea for dealing with cmin/cmax
Date: 2006-10-02 01:52:48
Message-ID: 20061002101927.5A39.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> "Jim C. Nasby" <jim(at)nasby(dot)net> writes:
> > Dumb question... wouldn't getting down to 20 bytes buy us something?
>
> BTW, the apparently useless byte after the 27- or 23-byte header
> actually has some good use: in a table of up to 8 columns, you can
> fit a null bitmap there "for free". In a scheme that took us down
> to 20 rather than 19 bytes, even a narrow table would pay the full
> maxalign price for having a null.

We may use "free" bytes for other purposes. For example, if we increase
the size of XIDs from 4 to 6 bytes, we can get rid of transaction
wraparound problem. There may be some other uses.

> I'm in favor of combining cmin/cmax/xvac to get us down to 23 bytes,
> but I think anything beyond that is going to face a serious problem
> of greatly increased cost for diminishing returns.

If we really want to reduce the size of headers to 16 bytes,
we maybe need to do with HeapTupleHeaderData.t_ctid .

Under the assumption that tuples are offen updated in the same page,
we only need offsets in the page to link an old tuple to new one.
We can reduce the size of t_ctid from 6 to 2 bytes. When tuples
are updated to other pages, we probably need "phantom ctid".

In another assumption that tuples are offen updated after frozen,
we can overlap ctid and xmin to a physical field using union.
But "phantom xids" are needed to update unfrozen tuples.

However, I think both assumptions have less probability than
the one assumed when we introduce phantom cids.
The above ideas probably do not work well.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chris Dunlop 2006-10-02 02:19:50 Update using sub-select table in schema
Previous Message David Fetter 2006-10-02 00:46:02 Re: [HACKERS] Numeric overflow problem + patch