Re: BUG #1756: PQexec eats huge amounts of memory - Mailing list pgsql-bugs

From Neil Conway
Subject Re: BUG #1756: PQexec eats huge amounts of memory
Date
Msg-id 42CCC395.7080204@samurai.com
Whole thread Raw
In response to BUG #1756: PQexec eats huge amounts of memory  ("Denis Vlasenko" <vda@ilport.com.ua>)
Responses Re: BUG #1756: PQexec eats huge amounts of memory
List pgsql-bugs
Denis Vlasenko wrote:
> Symptom: even the simplest query
> $result = pg_query($db, "SELECT * FROM big_table");
> eats enormous amounts of memory on server
> (proportional to table size).

Right, which is exactly what you would expect. The entire result set is
sent to the client and stored in local memory; if you only want to
process part of the result set at a time, use a cursor.

(And I'm a little suspicious that the performance of "SELECT * FROM
big_table" will contribute to a meaningful comparison between database
systems.)

-Neil

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Creating trigger function with argument(s) gets backend crash.
Next
From: Neil Conway
Date:
Subject: Re: BUG #1756: PQexec eats huge amounts of memory