X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id BC4C29FA5D2 for ; Mon, 5 Jun 2006 12:54:00 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 32800-08 for ; Mon, 5 Jun 2006 12:53:51 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id DFA419FA2DB for ; Mon, 5 Jun 2006 12:53:50 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id B6DB956450; Mon, 5 Jun 2006 10:53:49 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Mon, 5 Jun 2006 10:53:49 -0500 Date: Mon, 5 Jun 2006 10:53:49 -0500 From: "Jim C. Nasby" To: Tom Lane Cc: Zoltan Boszormenyi , pgsql-hackers@postgresql.org Subject: Re: [PERFORM] psql -A (unaligned format) eats too much memory Message-ID: <20060605155349.GU53487@pervasive.com> References: <44835834.2020309@dunaweb.hu> <44835F86.5040008@dunaweb.hu> <20060605152258.GT53487@pervasive.com> <20512.1149521250@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20512.1149521250@sss.pgh.pa.us> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060605:tgl@sss.pgh.pa.us::RmaCK4o+HF1bGUeL:00000000000000000000 0000000000000000000000000bNt X-Hashcash: 1:20:060605:zboszor@dunaweb.hu::cCxo9N7lZATarRZi:0000000000000000000 0000000000000000000000000TvE X-Hashcash: 1:20:060605:pgsql-hackers@postgresql.org::B7yTh18swwe1+K+Y:000000000 0000000000000000000000003Yay X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/158 X-Sequence-Number: 84391 On Mon, Jun 05, 2006 at 11:27:30AM -0400, Tom Lane wrote: > "Jim C. Nasby" 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? Nope. > 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... -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461