Re: [HACKERS] [WIP] [B-Tree] Keep indexes sorted by heap physical location - Mailing list pgsql-hackers

From Claudio Freire
Subject Re: [HACKERS] [WIP] [B-Tree] Keep indexes sorted by heap physical location
Date
Msg-id CAGTBQpZriMOm0hoN=4bLdT_GrH_p-y_TarQfZ-pAMK=DpVu3cA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] [WIP] [B-Tree] Keep indexes sorted by heap physical location  (Peter Geoghegan <pg@bowt.ie>)
Responses Re: [HACKERS] [WIP] [B-Tree] Keep indexes sorted by heap physical location
List pgsql-hackers
On Mon, Jul 24, 2017 at 2:02 PM, Peter Geoghegan <pg@bowt.ie> wrote:
> On Mon, Jul 24, 2017 at 9:51 AM, Claudio Freire <klaussfreire@gmail.com> wrote:
>> My point was that the TID doesn't have to point to an actual tuple.
>>
>> It's more of a keyspace thing, so it doesn't need to match real
>> tuples, it can just divide the keyspace with an arbitrary cutoff, and
>> should be cheapter to maintain without that requirement.
>
> I agree, but unless you're using normalized keys, then I don't see
> that you get much useful leeway from using fake or truncated TID
> values. Presumably the comparison logic will be based on comparing an
> ItemPointerData field, which is impractical to truncate.

In most cases, the TID itself can be omitted when the key itself
differs already.

When a split happens, a TID will be added referring to a real tid from
a child page iff necessary.

This gives a lot of leeway in choosing the cutoff point, since a
cutoff point is only added when necessary.

Vacuum *might* be able to redistribute tuples too, while holding locks
to all 3 pages (the two children and the parent page), since it can
move the TID to the middle point of two actual child TIDs, mindlessly,
without checking to see if such TID actually exists - it just needs to
choose a TID cutoff point that will distribute item pointers evently.
I haven't tried this, but it is theoretically possible.



pgsql-hackers by date:

Previous
From: Sokolov Yura
Date:
Subject: Re: [HACKERS] Increase Vacuum ring buffer.
Next
From: Jeff Janes
Date:
Subject: Re: [HACKERS] Increase Vacuum ring buffer.