Re: Memory exhaustion on large query

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Memory exhaustion on large query
Дата
Msg-id 106300.1639334631@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Memory exhaustion on large query  (Brice André <brice@famille-andre.be>)
Ответы Re: Memory exhaustion on large query  (Brice André <brice@famille-andre.be>)
Список pgsql-sql
=?UTF-8?B?QnJpY2UgQW5kcsOp?= <brice@famille-andre.be> writes:
> The content of the table is so huge that, if PQsendQueryPrepared retrieves
> all data, or if postgresql engine is creating temp file with all data, the
> query cannot succeed (I have no enough RAM or disk space to copy the whole
> data). But I was expecting that using PQsendQueryPrepared and PQgetResult
> would avoid this by returning one result at a time.

You're confusing asynchronous mode with single-row mode.  Async mode,
per se, doesn't change memory consumption; it just lets you do something
else while waiting for the query result.  You are (I suppose) missing
a call to PQsetSingleRowMode --- see

https://www.postgresql.org/docs/current/libpq-single-row-mode.html

            regards, tom lane



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

Предыдущее
От: Erik Brandsberg
Дата:
Сообщение: Re: Memory exhaustion on large query
Следующее
От: JORGE MALDONADO
Дата:
Сообщение: 5 tables with 3 different relation cases