Re: [HACKERS] libpq: why we need to fetch all rows?

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] libpq: why we need to fetch all rows?
Дата
Msg-id e29511d34a55dbc3daa2995ad73eede8
обсуждение исходный текст
Ответ на [HACKERS] libpq: why we need to fetch all rows?  (Alexander Demenshin <aldem@techie.com>)
Список pgsql-hackers
>
> 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.

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.


- --
Bruce Momjian
maillist@candle.pha.pa.us

------------------------------

В списке pgsql-hackers по дате отправления: