Re: [PATCH] Extending pg_class info + more flexible TOAST chunk size - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: [PATCH] Extending pg_class info + more flexible TOAST chunk size
Date
Msg-id 48F311A5.9060809@enterprisedb.com
Whole thread Raw
In response to Re: [PATCH] Extending pg_class info + more flexible TOAST chunk size  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Responses Re: [PATCH] Extending pg_class info + more flexible TOAST chunk size
List pgsql-hackers
Zdenek Kotala wrote:
> Heikki Linnakangas napsal(a):
>> Not all chunks need to be the same size. We do currently require that, 
>> but AFAICS it's only because that allows random access to a given 
>> offset within a datum. That's of course nice, but I think we could 
>> live without it. 
> 
> Good point. I think it is good to keep this feature.

Yeah. At the moment, it's only used for substring(), I think.

>> Or try random access with the new toast size first, and if the chunks 
>> turn out to be different size, fall back to reading all chunks 
>> sequentially. 
> 
> I think it is not necessary to read it sequentially, only you need to 
> recompute new position.

Yeah, true.

It occurs to me that instead of storing a chunk id, we could store a 
byte offset of the chunk. That would allow random access even if every 
chunk was of different size. You probably don't want any new changes you 
need to deal with in the upgrade, though :-).

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


pgsql-hackers by date:

Previous
From: "Bramandia Ramadhana"
Date:
Subject: Re: Block nested loop join
Next
From: Gregory Stark
Date:
Subject: Re: Convert check constraints into One-Time_Filter on prepared statements