Re: Selecting Large Object and TOAST - Mailing list pgsql-general

From Greg Stark
Subject Re: Selecting Large Object and TOAST
Date
Msg-id 87lkyzjm1q.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Selecting Large Object and TOAST  (vishal saberwal <vishalsaberwal@gmail.com>)
List pgsql-general
vishal saberwal <vishalsaberwal@gmail.com> writes:

> So are you suggesting, I need to send the Large object ID to the client?
> Since the application is time critical, is there a way to skip one of the
> two steps (querying once for LOID and then again for its data) to a one step
> by sending the Object data in the first call?

The main reason to use large objects at all is if you have a need to read and
write *parts* of the data. For instance if your data is being served up by a
web server then you may want to be able to pipeline the data in chunks instead
of waiting until you can download the entire object from the database. So you
would use loread() to read out one chunk, stuff it into your network buffers,
then loop back and loread() the next chunk.

If all you want to do is store and read the entire object in a single query
then large objects don't really have any advantage for you. Postgres removes
many of the limitations that legacy databases imposed on regular data types
that made large objects necessary for such routine storage.

--
greg

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Preventing or controlling runaway queries
Next
From: Eric E
Date:
Subject: Re: Preventing or controlling runaway queries