Re: Selecting Large Object and TOAST

From: Greg Stark <gsstark(at)mit(dot)edu>
To: vishal saberwal <vishalsaberwal(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Selecting Large Object and TOAST
Date: 2005-12-05 21:01:21
Message-ID: 87lkyzjm1q.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


vishal saberwal <vishalsaberwal(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Eric E 2005-12-05 21:33:59 Re: Preventing or controlling runaway queries
Previous Message Tom Lane 2005-12-05 20:57:27 Re: Preventing or controlling runaway queries