Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 4B2B92E004A for ; Tue, 1 Apr 2008 16:58:02 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 36017-08 for ; Tue, 1 Apr 2008 16:57:55 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [129.241.93.19]) by developer.postgresql.org (Postfix) with ESMTP id CAF162E002D for ; Tue, 1 Apr 2008 16:57:58 -0300 (ADT) Received: from trofast.ipv6.sesse.net ([2001:700:300:1803:20e:cff:fe36:a766] helo=trofast.sesse.net) by cassarossa.samfundet.no with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Jgmc4-0001c8-PM for pgsql-performance@postgresql.org; Tue, 01 Apr 2008 21:57:45 +0200 Received: from root by trofast.sesse.net with local (Exim 4.69) (envelope-from ) id 1Jgmc4-0005xc-5a for pgsql-performance@postgresql.org; Tue, 01 Apr 2008 21:57:44 +0200 Date: Tue, 1 Apr 2008 21:57:44 +0200 From: "Steinar H. Gunderson" To: pgsql-performance@postgresql.org Subject: Re: Cursors and different settings for default_statistics_target Message-ID: <20080401195744.GA22880@uio.no> Mail-Followup-To: pgsql-performance@postgresql.org References: <2798.1207063805@sss.pgh.pa.us> <9629.1207066619@sss.pgh.pa.us> <9999.1207068123@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <9999.1207068123@sss.pgh.pa.us> X-Operating-System: Linux 2.6.20.4 on a x86_64 User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/13 X-Sequence-Number: 29506 On Tue, Apr 01, 2008 at 12:42:03PM -0400, Tom Lane wrote: >> That's CURSOR_OPT_FAST_PLAN and isn't it? Our application reads the full >> results of most cursors. > Just out of curiosity, why use a cursor at all then? This isn't the same scenario as the OP, but I've used a cursor in cases where I cannot keep all of the dataset in memory at the client at once, but I _can_ coerce it down to a more manageable size as it comes in. I don't know if a cursor is the only way to do this (short of making a custom function inside Postgres of some sort), but it seems to be the simplest way in libpqxx, at least. /* Steinar */ -- Homepage: http://www.sesse.net/