Re: out of memory for query result

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: out of memory for query result
Дата
Msg-id 20060503191239.GE27354@svana.org
обсуждение исходный текст
Ответ на Re: out of memory for query result  (Sven Willenberger <sven@dmv.com>)
Список pgsql-general
On Wed, May 03, 2006 at 02:52:57PM -0400, Sven Willenberger wrote:
> Using identical data and identical queries, why would the amd64 system
> using postgresql 8.1.3 be using some 2/3s more memory to store the query
> results before output than the i386 system using postgresql 8.0.4?

Is the amd64 system running 64-bit code? If so, the all the pointers
would double in size. That together with additional alignment
requirements could explain it.

> These are the final stages after the file has flushed (this was run on
> the prior month's data which had fewer results). This would either point
> to an issue with a) amd64 memory allocation or b) palloc interacting
> with 64bit memory or c) some other change.

psql doesn't use palloc. palloc exists purely in the backend.

> For now I will try the cursor technique; I assume that if this is run
> from within a function returning setof xxxx that I will run into the
> same issue?

The memory usage is purely the client trying to store the entire
dataset in memory. If your function is using the output but not
storing, there is ofcourse no problem.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

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

Предыдущее
От: "Guy Rouillier"
Дата:
Сообщение: Re: How does an application recognize the death of the postmaster
Следующее
От: "Christo Romberg"
Дата:
Сообщение: Connection error, help..please