Re: [PATCH] Extending pg_class info + more flexible TOAST chunk size

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Extending pg_class info + more flexible TOAST chunk size
Date: 2008-10-13 09:15:17
Message-ID: 48F311A5.9060809@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2008-10-13 09:38:20 Re: Convert check constraints into One-Time_Filter on prepared statements
Previous Message Bramandia Ramadhana 2008-10-13 09:14:18 Re: Block nested loop join