Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XaQXe-00026y-NI for pgsql-jdbc@arkaria.postgresql.org; Sat, 04 Oct 2014 14:42:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XaQXd-000331-Uz for pgsql-jdbc@arkaria.postgresql.org; Sat, 04 Oct 2014 14:42:37 +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 1XaQXc-00032s-07 for pgsql-jdbc@postgresql.org; Sat, 04 Oct 2014 14:42:36 +0000 Received: from mout.kundenserver.de ([212.227.17.13]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XaQXW-0006WT-Sh for pgsql-jdbc@postgresql.org; Sat, 04 Oct 2014 14:42:32 +0000 Received: from ayaki.localdomain (106-68-71-91.dyn.iinet.net.au [106.68.71.91]) by mrelayeu.kundenserver.de (node=mreue102) with ESMTP (Nemesis) id 0LpfUc-1Y71XL1STe-00fPxX; Sat, 04 Oct 2014 16:42:18 +0200 Message-ID: <54300745.5080206@2ndquadrant.com> Date: Sat, 04 Oct 2014 22:42:13 +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: 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> In-Reply-To: <542091F0.10706@hogranch.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:eXy4nAhB8ZvPfXB+gLMvHpMvoAQaN6yFhX/CFbJlShz Lz0o3fxnxGf9KRTaO4IT5XhkSMSmTGLDu+Kv9kUuQNuoBePBxk ISvF+0Bbv5PE5aoVrzZHy0UJSMI1DpjzYVwa8FIODGm6mDGt4G 905iv7sAo76KwTTaRDSxPw3U8W92O/i0X/WCkjKLAbmEFakT5Y Pjh2DXOT7lFhP89pKj1JaA/glbBzsnLSm0hOPAdMwBhEhxBLmD j8hDQ/fTukM0+n2Ou8xFnE5Npq8JltHxqO8/QqGIy+l/QiOfkz AF0XKcH6y5vBT0ckfr0yka0W+awDnaZKnFYAcQzlCFA2LLZg/4 /7Nzynnz34Zp/OSc4XWgQIWkpKwiHdxWGqfKpMMeU 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 05:17 AM, John R Pierce wrote: >> > > this still won't address the issue that the postgresql server itself > ALSO marshals the entire result set into ITS memory before sending it to > the client. Really, using cursors for large result-sets is the correct > way to go. Er, it what? It does no such thing. For some queries it must prepare the entire result before it can send it - e.g. if there's a top-level sort node that can't be satisfied by an index-scan of the table in the desired sort order. It'll marshal such results to disk if they don't fit within working memory, though. (Look into the tuplestore code for details). -- 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