[Bizgres-general] Re: Latest bitmap patch results. (tuple offset out of range)

Mark Kirkwood markir at paradise.net.nz
Tue Jan 31 01:57:28 GMT 2006


Jie Zhang wrote:
> Mark,
> 
> 
> 
>>I am seeing some offsets being calculated bigger than tidscan.c likes - e.g:
> 
> 
> 
>>bitmap=# SELECT count(*) FROM bitmaptest WHERE val2 = 70;
>>ERROR:  tuple offset out of range: 257
> 
> 
>>It looks like there some something not quite right with the set bit run 
>>encoding for this case, as it has encoded a run for 63 8-bit words...
> 
> 
> Can you provide me with your test case about this?
>

On a related note, earlier Simon and I did a few calculations concerning 
how many tuples fit on a heap page - well looks like we should have 
examined tidbitmap.c where this is calculated more conservatively:

(src/backend/nodes/tidbitmap.c):
#define MAX_TUPLES_PER_PAGE  ((BLCKSZ - 1) / 
MAXALIGN(offsetof(HeapTupleHeaderData, t_bits) + sizeof(ItemIdData)) + 1)

Now Bizgres is using (src/include/access/bitmap.h):

#define MaxNumHeapTuples    ((OffsetNumber) 
(BLCKSZ/sizeof(HeapTupleHeaderData)))

These work out at 256 and 292 respectively, for the typical case - 
perhaps the same calculation should be used in bitmap.h?

Cheers

Mark





More information about the Bizgres-general mailing list