Re: Video storage in Postgres?

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: <josh(at)agliodbs(dot)com>
Cc: <pgsql-advocacy(at)postgresql(dot)org>, "Bob Zurek" <bob(dot)zurek(at)enterprisedb(dot)com>
Subject: Re: Video storage in Postgres?
Date: 2007-08-17 19:06:39
Message-ID: 87vebet1z4.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy


"Josh Berkus" <josh(at)agliodbs(dot)com> writes:

> For most applications, it makes more sense to store video in the filesystem
> and not in the DB. Also for *retrieval* of video, we have an issue; libpq
> really needs a way to retrive large data 1MB at a time and not wait for
> the whole field/row.

I'm sure you realize you can do this using lo_* but you can also do it using
TOAST if the toasted data is uncompressed. substr() on text fields and bytea
will fetch only the TOAST chunks it needs to satisfy the range requested.

If you mark the column as storage EXTERNAL then issue a series of selects with
successive substring() ranges -- you could prepare the query once and then
stream executes for the successive ranges, you can process the data in chunks.

It's not as slick as having libpq do it in general but an awful lot of things
would have to change to make streaming out a video stored in a single datum
possible -- not just in libpq but in the server as well.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-advocacy by date

  From Date Subject
Next Message Lukas Kahwe Smith 2007-08-17 21:32:57 Re: Video storage in Postgres?
Previous Message Josh Berkus 2007-08-17 18:14:47 Re: Video storage in Postgres?