Re: random access - bytea

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
Cc: Joe Conway <mail(at)joeconway(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: random access - bytea
Date: 2003-10-26 14:56:12
Message-ID: 1067180172.2604.6.camel@fuji.krosing.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dennis Bjorklund kirjutas P, 26.10.2003 kell 07:30:
> On Sat, 25 Oct 2003, Joe Conway wrote:
>
> > That will modify the bytea column so that it is stored uncompressed in
> > the TOAST table.
> >
> > Now, simply use substr() to grab any random chunk:
> > SELECT substr(foo_bytea, 20000, 100) from foo where foo_id = 42;
>
> This would imply that every little read would have to do a scan on a table
> to find the row and then to perform the substr. An open command can
> be optimized a lot more, for example to cache entries that have been
> opened so that it's fast to read the next 1kb or whatever you want.
>
> Also, the above does not solve writes at all which can also be made
> transaction safe and fast with a better api where you can update a part
> of a field.

I brought it up once and Tom answered that TOAST tables are not
transaction aware, so you can't update just some parts of toasted
entities - you must always write the whole fields. So this will not be
just an api change.

> The above is not really a replacement of the current lo-objects.

True.

-------------
Hannu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dennis Bjorklund 2003-10-26 15:04:46 Re: random access - bytea
Previous Message Dennis Bjorklund 2003-10-26 14:38:35 Re: random access - bytea