You can put my comments on the "Reader's corner", if you have one.
On Sun, 29 Jun 1997, Bruce Momjian wrote:
> >
> > On Sun, 29 Jun 1997, Bruce Momjian wrote:
> >
> > > >
> > > > On Sun, 29 Jun 1997, Bruce Momjian wrote:
> > > >
> > > > > > On Sun, 29 Jun 1997, Bruce Momjian wrote:
> > >
> > > But then, what is the goal? A temp table is going to be a performance
> > > hit, and so is passing one row at a time from the backend.
> >
> > I see two goals, first you save memory on the client. Next you
> > improve performance since you don't have to transfer all of a large
> > dataset to a client. On a multi-megabyte result this can be a
> > very big win.
>
> OK, saving memory on the client is a valid goal. You could process and
> discard one before getting the next row.
Sending rows ASAF (as soon as they were fetched) could save memory on the
backend, which is also a valid goal!
>
> As far as performance, if you are going to want to look at all the rows,
> you might as well get them all at once. There is no temp table on the
> server side, and the transfer via the socket happens with only one
> request to the backend. Much faster.
I tend to agree that sending raws ASAF could hit the performance, at
least the server throughput. The only thing you must be carefull about is
that (as pointed by somone before) the client is now part of the
transaction, so the application cannot use the data until commit point. Rows
can be send one by one or thousand by thousand, so that small results
could be got once. On large results client could write data to disk.
I will do some tests and I'll report in a couple of days. Since I am
phd-researching the optimization on the client side (using PostgreSQL, of
course!), I would like to pickup the idea. I formally require permission
to use it. You can choose to point to the one who owns it, to send me a
note to be included in some paper or just let me quote the whole
PostgreSQL development team :).
>
>
> --
> Bruce Momjian
> maillist@candle.pha.pa.us
>
Thanks, regards, aso
.co.
Costin Oproiu
co@deuroconsult.ro
postgres@deuroconsult.ro
------------------------------