Re: PG_PAGE_LAYOUT_VERSION 5 - time for change - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: PG_PAGE_LAYOUT_VERSION 5 - time for change
Date
Msg-id 490AB654.6040409@enterprisedb.com
Whole thread Raw
In response to Re: PG_PAGE_LAYOUT_VERSION 5 - time for change  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: PG_PAGE_LAYOUT_VERSION 5 - time for change
Re: PG_PAGE_LAYOUT_VERSION 5 - time for change
List pgsql-hackers
Tom Lane wrote:
> Gregory Stark <stark@enterprisedb.com> writes:
>> Tom Lane <tgl@sss.pgh.pa.us> writes:
>>> ... 3b sounds good until you
>>> reflect that a genuinely variable chunk size would preclude random
>>> access to sub-ranges of a toast value.  
> 
>> Hm, Heikki had me convinced it wouldn't but now that I try to explain it I
>> can't get it to work. I think the idea is you start a scan at the desired
>> offset and scan until you reach a chunk which overruns the end of the desired
>> piece. However you really need to start scanning at the last chunk *prior* to
>> the desired offset.
> 
> Yeah, that was my conclusion too.

Hmm, you're right. I think it can be made to work by storing the *end* 
offset of each chunk. To find the chunk containing offset X, search for 
the first chunk with end_offset > X.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: BufferAccessStrategy for bulk insert
Next
From: "Pavel Stehule"
Date:
Subject: Re: WIP patch: convert SQL-language functions to return tuplestores