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

From Denis Vlasenko
Subject Re: BUG #1756: PQexec eats huge amounts of memory
Date
Msg-id 200507070951.54660.vda@ilport.com.ua
Whole thread Raw
In response to Re: BUG #1756: PQexec eats huge amounts of memory  (Neil Conway <neilc@samurai.com>)
Responses Re: BUG #1756: PQexec eats huge amounts of memory  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-bugs
On Thursday 07 July 2005 08:54, Neil Conway wrote:
> 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.

The same php script but done against Oracle does not have this
behaviour.

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

I wanted to show colleagues which are Oracle admins that peak
data fetch rate of PostgreSQL is way better than Oracle one.

While it turned out to be true (Oracle+WinNT = 2kb TCP output buffer,
~1Mb/s over 100Mbit; PostgreSQL+Linux = 8kb buffer, ~2.6Mb/s),
I was ridiculed instead when my php script failed miserably,
crashing Apache with OOM condition, while alanogous script for Oracle
ran to completion just fine.
--
vda

pgsql-bugs by date:

Previous
From: Denis Vlasenko
Date:
Subject: Re: BUG #1756: PQexec eats huge amounts of memory
Next
From: "Boris Sukholitko"
Date:
Subject: BUG #1759: domain check constraint ignored in prepared statement