Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xc3Xg-0005o9-9R for pgsql-jdbc@arkaria.postgresql.org; Thu, 09 Oct 2014 02:33:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xc3Xf-0000ue-8y for pgsql-jdbc@arkaria.postgresql.org; Thu, 09 Oct 2014 02:33:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xc3Xe-0000uX-Cz for pgsql-jdbc@postgresql.org; Thu, 09 Oct 2014 02:33:22 +0000 Received: from mout.kundenserver.de ([212.227.17.13]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xc3Xa-0006Xn-9q for pgsql-jdbc@postgresql.org; Thu, 09 Oct 2014 02:33:21 +0000 Received: from ayaki.localdomain (pjobri.lnk.telstra.net [110.143.218.179]) by mrelayeu.kundenserver.de (node=mreue105) with ESMTP (Nemesis) id 0MSJh5-1XnETE2LsJ-00TSCb; Thu, 09 Oct 2014 04:33:06 +0200 Message-ID: <5435F3DA.1060401@2ndquadrant.com> Date: Thu, 09 Oct 2014 10:32:58 +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: Vitalii Tymchyshyn CC: Tom Lane , John R Pierce , PG-JDBC Mailing 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> <54300AA6.3040309@2ndquadrant.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:5fA5xkIQ7ZxZ/mvczKgqpS3st8vtBN1tj9uufoGj7Ka Rt98Cp32Wi0FK8SUBPDS3tA8dpnTjOP6/Qz6oynz0v8uBUnpkV oKXsLpU67VO2Fnk9AKpX7tp573Q1+WxSc0H8jZ9cL3d5haX0uQ ISWt0GoLkZnCVi4XYEThXCF3g9abHGp8fVvLAf2jI6LCIzUmfI aWbRJNKKOFp53H9zm54DmV3df342gqSEMkxLnOCo76JvUF7xI+ Dei70RcFKHO6LVVvsND4ovGhW4oDlhvNzBgvyxo5sNakEvFqF6 xXOBWtSR/KSoPahHiz2Lw0LW1b8/d5zV3qfXkVnoHMMLEqawbT yqHN0sJkE7QPpI3Bm60M+oGLADXc9r90Y1SNzYXGW X-UI-Out-Filterresults: notjunk:1; X-Pg-Spam-Score: -1.9 (-) 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 10/05/2014 11:24 AM, Vitalii Tymchyshyn wrote: > Hello, all > > I've made a draft implementation of setFetchSize in autocommit mode > here: https://github.com/tivv/pgjdbc/tree/autocommit_fetchsize > Tests look good. > Note that it does not try to limit Execute size as I don't think I > understand protocol fully. I really recommend addressing that part, then. The protocol is pretty well documented; it doesn't make sense implementing a new and somewhat complex approach if a simpler one is possible and might be cleaner. > The only thing it does is that it does not > read everything before returning to the caller. Instead it reads > response rows in fetchSize batches. If another statement tries to use > the same connection, full result is read immediatelly (this part is not > tested yet). I'm still not convinced that reading the result set when the next statement is run is the right answer. I'd really like to be able to have the driver return a Runnable or Future that lets the application assign the reading of the rest of the result set to a thread, so it can be completed _before_ the app needs to run another query. If the current query isn't fully fetched when the next one is run, I'd prefer to just throw an exception indicating that the previous query must be fetched. Let the application deal with it. I really don't like muddling queries together like this. (That also means exceptions get dispatched in the right place - the fetch of the prior query). -- 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