Re: where does postgres keep the query result until it is returned?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: where does postgres keep the query result until it is returned?
Дата
Msg-id 10246.1284732820@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: where does postgres keep the query result until it is returned?  (Sam Mason <sam@samason.me.uk>)
Ответы Re: where does postgres keep the query result until it is returned?  (Willy-Bas Loos <willybas@gmail.com>)
Список pgsql-general
Sam Mason <sam@samason.me.uk> writes:
> On Fri, Sep 17, 2010 at 02:14:57PM +0100, Sam Mason wrote:
>> Postgres, the server software, will spill large results (and any
>> intermediate working sets) to disk automatically as needed.  I believe
>> any memory allocated for this task will be up to work_mem in size.

> That wasn't very clear was it; when I said "this task" I meant the task
> of accumulating results before things spill.

If the question was about the final query result sent to the client:
we don't spill that to disk, nor "hold" it anywhere.  The backend
sends it to the client on-the-fly as each row is generated.  It's
the client's responsibility to cope if the result set is huge.
(As you noted, libpq is none too bright about that.)

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: What's wrong with this query?
Следующее
От: Willy-Bas Loos
Дата:
Сообщение: Re: where does postgres keep the query result until it is returned?