Re: [HACKERS] CLUSTER can change t_len

2010-11-09 Thread Heikki Linnakangas
On 09.11.2010 17:14, Tom Lane wrote: Heikki Linnakangas 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

Re: [HACKERS] CLUSTER can change t_len

2010-11-09 Thread Heikki Linnakangas
On 09.11.2010 15:57, Greg Stark wrote: On Tue, Nov 9, 2010 at 10:20 AM, Heikki Linnakangas 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 t

Re: [HACKERS] CLUSTER can change t_len

2010-11-09 Thread Greg Stark
On Tue, Nov 9, 2010 at 10:20 AM, Heikki Linnakangas 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.

Re: [HACKERS] CLUSTER can change t_len

2010-11-09 Thread Tom Lane
Heikki Linnakangas 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 MAXAL

Re: [HACKERS] CLUSTER can change t_len

2010-11-09 Thread Heikki Linnakangas
On 09.11.2010 11:11, Itagaki Takahiro wrote: On Tue, Nov 9, 2010 at 12:44 PM, Jeff Davis wrote: See case below. After the item length gets changed, then when reading the tuple later you get a t_len that includes padding. We can easily find it with pageinspect: \i pageinspect.sql create table

Re: [HACKERS] CLUSTER can change t_len

2010-11-09 Thread Itagaki Takahiro
On Tue, Nov 9, 2010 at 12:44 PM, Jeff Davis wrote: > See case below. After the item length gets changed, then when reading > the tuple later you get a t_len that includes padding. We can easily find it with pageinspect: \i pageinspect.sql create table foo(i int4); insert into foo values(1); SELE

[HACKERS] CLUSTER can change t_len

2010-11-08 Thread Jeff Davis
I don't think that this is a bug exactly, but it seems inconsistent. See case below. After the item length gets changed, then when reading the tuple later you get a t_len that includes padding. We should document in a comment that t_len can mean multiple things. Or, we should fix raw_heap_insert(