Re: CLUSTER can change t_len

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>, Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: CLUSTER can change t_len
Date: 2010-11-09 15:14:09
Message-ID: 17846.1289315649@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
> On 09.11.2010 11:11, Itagaki Takahiro wrote:
>> We have a comment /* be conservative */ in the function, but I'm not sure
>> we actually need the MAXALIGN. However, there would be almost no benefits
>> to keep t_len in small value because we often treat memory in MAXALIGN unit.

> Hmm, the conservatism at that point affects the free space calculations.
> I'm not sure if it makes any difference in practice, but I'm also not
> sure it doesn't. pd_upper is always MAXALIGNed, but pd_lower is not.

I tend to agree with Jeff's original point that the behavior should
match regular tuple insertion exactly. This isn't about saving space,
because it won't; it's about not confusing readers by doing the same
thing in randomly different ways. I will also note that the regular
path is FAR better tested than raw_heap_insert. If there are any bugs
here, it's 1000:1 they're in raw_heap_insert not the regular path.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2010-11-09 15:25:23 Re: Protecting against unexpected zero-pages: proposal
Previous Message Andrew Dunstan 2010-11-09 15:12:03 Re: W3C Specs: Web SQL