Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XaQZu-0002Ad-UN for pgsql-jdbc@arkaria.postgresql.org; Sat, 04 Oct 2014 14:44:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XaQZu-0003tP-Ey for pgsql-jdbc@arkaria.postgresql.org; Sat, 04 Oct 2014 14:44:58 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XaQZt-0003s1-Qa for pgsql-jdbc@postgresql.org; Sat, 04 Oct 2014 14:44:57 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XaQZq-0006X1-Le for pgsql-jdbc@postgresql.org; Sat, 04 Oct 2014 14:44:56 +0000 Received: from ayaki.localdomain (106-68-71-91.dyn.iinet.net.au [106.68.71.91]) by mrelayeu.kundenserver.de (node=mreue105) with ESMTP (Nemesis) id 0M5xYf-1YPWsq0aYD-00xrGt; Sat, 04 Oct 2014 16:44:43 +0200 Message-ID: <543007D4.6070109@2ndquadrant.com> Date: Sat, 04 Oct 2014 22:44:36 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: "Lussier, Denis" , Tom Lane CC: John R Pierce , List Subject: Re: Disk buffering of resultsets References: <541E7FC3.3000201@2ndquadrant.com> <3F6D0B4E-2FA9-42D0-8C2C-DC68E6D0D641@gmail.com> <54205F94.9010102@hogranch.com> <542091F0.10706@hogranch.com> <1321.1411433175@sss.pgh.pa.us> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:rILggKCMeQDsOwHgjCXo0W7es4721NnZvIenY0jgL9v hrA1hMldcEmIXit7T/JqfBboThfXEWSvuEscmBN4YEx/tOKXTb Lcl3thWLgwYZAfUychUMo7vkbFbLqIfjnDTyD1cbyrDrzviP9N Bg29x47Pkx82HkYz+TbMGHla/CbvSKgxv9x/vm7fppUKbouRfE fQkeVL0ndQbWW/hjWpFnGwvMTc6zOxntMalb+18DGK6LLB7B2l ZhAoV7bY59S5mRONA/xtpV+nvEplP/dF5udY1syaylnpxikMGL afr0yYweO2OcCHjisPppGje+1s713Ae9mXywxLafuIFTnPfew/ rdtoRdFiaGXtb5YOWzN//qUa2XzEybvSQQX3P5Er9 X-UI-Out-Filterresults: notjunk:1; X-Pg-Spam-Score: -2.1 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org On 09/23/2014 09:55 AM, Lussier, Denis wrote: > Wow... really glad Tom chimed in on this. I've been promoting/using > PG as an enterprise-class database for over a decade and I was > struggling with the "fact" that the server doesn't iterate thru a cursor > without bringing it all into memory. Well, that assertion would've failed the common-sense sanity test anyway. You can `SELECT * FROM my_100GB_table` on a machine with 1GB of RAM. Clearly this is impossible if Pg must marshal all the results into RAM first. I think John's misapprehension probably stemmed from the fact that libpq and many other clients *default* to fetching the whole result from the server into RAM before reporting success to the caller. This makes it *seem* like the server must marshal the whole result in memory, but it's the client doing that, not the server. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc