Skip site navigation (1) Skip section navigation (2)

Re: BUG #1756: PQexec eats huge amounts of memory

From: Denis Vlasenko <vda(at)ilport(dot)com(dot)ua>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1756: PQexec eats huge amounts of memory
Date: 2005-07-07 06:51:54
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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

> (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.

In response to


pgsql-bugs by date

Next:From: Neil ConwayDate: 2005-07-07 07:31:09
Subject: Re: BUG #1756: PQexec eats huge amounts of memory
Previous:From: Neil ConwayDate: 2005-07-07 05:54:29
Subject: Re: BUG #1756: PQexec eats huge amounts of memory

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group