Re: [HACKERS] Bizarre coding in _bt_binsrch - Mailing list pgsql-hackers

From Vadim Mikheev
Subject Re: [HACKERS] Bizarre coding in _bt_binsrch
Date
Msg-id 375B9CB8.23725C88@krs.ru
Whole thread Raw
In response to Re: [HACKERS] Bizarre coding in _bt_binsrch  (ZEUGSWETTER Andreas IZ5 <Andreas.Zeugswetter@telecom.at>)
List pgsql-hackers
ZEUGSWETTER Andreas IZ5 wrote:
> 
> > The main problem is just programistic: you will have to add
> > heap tid to the end of index tuples on internal index pages,
> > but on leaf pages heap tid is in the begin of index tuples
> > (inside of btitem struct).
> >
> While I absolutely like the idea of having the heap tid in the index,
> I don't quite agree, that leaf pages need heap tid at the front of the key.

Oh no - this is not what I meant to say.

First, there is no heap tid in index tuples in internal pages,
and so we'll have to add it to them. Actually, it doesn't matter
where to add it - just after btitem->bti_itup (i.e. header of
index tuple) or after field keys - it will be the last key used
in comparing.

But on leaf pages index tuples already keep heap tid - this is
btitem->bti_itup.t_tid - and so we shouldn't add heap tid there.

I just wanted to say that we'll have to differentiate 
internal/leaf index tuples in _bt_compare, _bt_binsrch etc 
to know from what part of index tuples heap tid should be fetched.

Sorry.

Vadim


pgsql-hackers by date:

Previous
From: ZEUGSWETTER Andreas IZ5
Date:
Subject: Re: [HACKERS] Priorities for 6.6
Next
From: Vadim Mikheev
Date:
Subject: Re: [HACKERS] Bizarre coding in _bt_binsrch