Re: [PERFORM] psql -A (unaligned format) eats too much memory

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
Cc: Zoltan Boszormenyi <zboszor(at)dunaweb(dot)hu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PERFORM] psql -A (unaligned format) eats too much memory
Date: 2006-06-05 16:00:35
Message-ID: 20813.1149523235@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

"Jim C. Nasby" <jnasby(at)pervasive(dot)com> writes:
> On Mon, Jun 05, 2006 at 11:27:30AM -0400, Tom Lane wrote:
>> I'm reading this as just another uninformed complaint about libpq's
>> habit of buffering the whole query result. It's possible that there's
>> a memory leak in the -A path specifically, but nothing said so far
>> provided any evidence for that.

> Certainly seems like it. It seems like it would be good to allow for
> libpq not to buffer, since there's cases where it's not needed...

See past discussions. The problem is that libpq's API says that when it
hands you back the completed query result, the command is complete and
guaranteed not to fail later. A streaming interface could not make that
guarantee, so it's not a transparent substitution.

I wouldn't have any strong objection to providing a separate API that
operates in a streaming fashion, but defining it is something no one's
bothered to do yet. In practice, if you have to code to a variant API,
it's not that much more trouble to use a cursor...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2006-06-05 16:40:38 Re: [PERFORM] psql -A (unaligned format) eats too much
Previous Message Teodor Sigaev 2006-06-05 15:58:02 Re: Connection Broken with Custom Dicts for TSearch2

Browse pgsql-performance by date

  From Date Subject
Next Message Andrew Dunstan 2006-06-05 16:40:38 Re: [PERFORM] psql -A (unaligned format) eats too much
Previous Message Jim C. Nasby 2006-06-05 15:53:49 Re: [PERFORM] psql -A (unaligned format) eats too much memory