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

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

From: Zoltan Boszormenyi <zboszor(at)dunaweb(dot)hu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>,pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PERFORM] psql -A (unaligned format) eats too much
Date: 2006-06-05 16:45:13
Message-ID: 44845F99.7050306@dunaweb.hu (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-performance
Hi!

Tom Lane írta:
> "Jim C. Nasby" <jnasby(at)pervasive(dot)com> writes:
>   
>> I've been able to verify this on 8.1.4; psql -A -t -c 'SELECT * FROM
>> largetable' > /dev/null results in psql consuming vast quantities of
>> memory. Why is this?
>>     
>
> Is it different without the -A?
>
> 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.
>
> 			regards, tom lane
>   

So, is libpq always buffering the result? Thanks.
I thought psql buffers only because in its formatted output mode
it has to know the widest value for all the columns.

Then the SELECT INTO TEMP ; COPY TO STDOUT solution
I found is _the_ solution.

I guess then the libpq-based ODBC driver suffers
from the same problem? It certainly explains the
performance problems I observed: the server
finishes the query, the ODBC driver (or libpq underneath)
fetches all the records and the application receives
the first record after all these. Nice.

Best regards,
Zoltán Böszörményi


In response to

pgsql-performance by date

Next:From: Mark WoodwardDate: 2006-06-05 16:48:12
Subject: Re: [PERFORM] psql -A (unaligned format) eats too much
Previous:From: Andrew DunstanDate: 2006-06-05 16:40:38
Subject: Re: [PERFORM] psql -A (unaligned format) eats too much

pgsql-hackers by date

Next:From: Mark WoodwardDate: 2006-06-05 16:48:12
Subject: Re: [PERFORM] psql -A (unaligned format) eats too much
Previous:From: Andrew DunstanDate: 2006-06-05 16:40:38
Subject: Re: [PERFORM] psql -A (unaligned format) eats too much

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