| От | Martijn van Oosterhout |
|---|---|
| Тема | Re: out of memory for query result |
| Дата | |
| Msg-id | 20051022201015.GG16589@svana.org обсуждение исходный текст |
| Ответ на | out of memory for query result (Allen <dba@girders.org>) |
| Ответы |
Re: out of memory for query result
|
| Список | pgsql-general |
On Sat, Oct 22, 2005 at 03:46:18PM -0400, Allen wrote:
> I am trying to select a result set from a 2-table join, which should be
> returning 5,045,358 rows. I receive this error:
>
> DBD::Pg::st execute failed: out of memory for query result
AFAIK, DBD:Pg never uses a cursor unless you ask it to. So you probably
want to code a loop like:
DECLARE CURSOR blah AS ...
while( FETCH 1000 )
{
process rows...
}
If you don't use a cursor in the backend, then DBI will try to pull the
*entire* result and store it in memory, which is why you don't have
enough...
Hope this helps,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера