Re: random access - bytea

Поиск
Список
Период
Сортировка
От Dennis Bjorklund
Тема Re: random access - bytea
Дата
Msg-id Pine.LNX.4.44.0310260624360.23254-100000@zigo.dhs.org
обсуждение исходный текст
Ответ на Re: random access - bytea  (Joe Conway <mail@joeconway.com>)
Ответы Re: random access - bytea  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Re: random access - bytea  (Hannu Krosing <hannu@tm.ee>)
Список pgsql-hackers
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.

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

-- 
/Dennis



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: random access - bytea
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: 7.4 compatibility question