X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id E635ED1C4DB for ; Thu, 20 May 2004 15:22:02 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 62333-10 for ; Thu, 20 May 2004 15:21:43 -0300 (ADT) Received: from vsmtp3alice.tin.it (vsmtp3alice.tin.it [212.216.176.143]) by svr1.postgresql.org (Postfix) with ESMTP id 90FCDD1B22D for ; Thu, 20 May 2004 15:21:41 -0300 (ADT) Received: from host223-78.pool80180.interbusiness.it (80.180.78.223) by vsmtp3alice.tin.it (7.0.027) id 40AB76440000E8DE; Thu, 20 May 2004 20:21:32 +0200 From: Andrea Aime To: Kris Jurka Subject: Re: Queries with large ResultSets Date: Thu, 20 May 2004 20:22:37 +0200 User-Agent: KMail/1.6.1 Cc: Jack Orenstein , pgsql-jdbc@postgresql.org References: <40ABD19C.8080109@geophile.com> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <200405202022.37646.andrea.aime@aliceposta.it> X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=2.5 tagged_above=0.0 required=5.0 tests=RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_NJABL, RCVD_IN_SORBS X-Spam-Level: ** X-Archive-Number: 200405/126 X-Sequence-Number: 10136 Alle 18:01, gioved=EC 20 maggio 2004, Kris Jurka ha scritto: > On Wed, 19 May 2004, Jack Orenstein wrote: > > If I'm reading the source code correctly, the PostgreSQL 7.3.4 JDBC > > driver creates a ResultSet by evaluating the entire query, and putting > > all the rows into a Vector. ResultSet.next() iterates over the > > Vector. Is that in fact what is happening? > > Yes, in the 7.3 driver. The 7.4 driver (which works quite well against a > 7.3 database) will use a cursor based fetch to retrieve a chunk of rows at > a time. There are a number of restrictions required to be able to use > this method (It only works with autocommit off and FORWARD_ONLY result > sets). To enable this use Statement.setFetchSize to indicate how many > rows at a time you want retrieved. Also there is a patch to the 7.5 > driver to be able to retrieve subsets of the resultset for the scrollable > variety and hopefully I should get that in soon. Ugh... those limitation are really frightening, this means we cannot fetch big quantities of data outside of a transaction... this is a problem with= =20 application servers like GeoServer that keep a connection pool and=20 need to fetch big quantities of data also outside a transaction... any hope to see this fixed soon? Is it a driver problem or a server limitation? Best regards Andrea Aime