Re: Selecting large objects stored as bytea

From: Tomasz Ostrowski <tometzky(at)batory(dot)org(dot)pl>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: Ludger Zachewitz <ludger(dot)zachewitz(at)gmx(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: Selecting large objects stored as bytea
Date: 2008-02-22 19:59:08
Message-ID: 20080222195907.GA10814@batory.org.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 22 Feb 2008, Daniel Verite wrote:

> You could use the function below that breaks a bytea value into
> pieces of 'chunksize' length and returns them as a set of rows.

When you do this then make sure that this column has external
storage:
alter column [column_name] set storage external;
Then getting this chunks will be fast.

But be aware that external storage does not compress data, so you
would need more space for database if your data is compressible. Also
you'd need to dump, truncate and restore this table, as storage
option is only honored for new rows. Maybe just "cluster
[table_name]" will do, I don't know.

Regards
Tometzky
--
...although Eating Honey was a very good thing to do, there was a
moment just before you began to eat it which was better than when you
were...
Winnie the Pooh

In response to

Browse pgsql-general by date

  From Date Subject
Next Message blackwater dev 2008-02-22 20:05:52 joining on concatonation?
Previous Message LARC/J.L.Shipman/jshipman 2008-02-22 18:24:53 reindexing