X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B507252A50 for ; Fri, 25 Feb 2005 19:05:36 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 51039-02 for ; Fri, 25 Feb 2005 19:05:35 +0000 (GMT) Received: from mail63.csoft.net (leary3.csoft.net [63.111.22.74]) by svr1.postgresql.org (Postfix) with SMTP id 3372F55CA8 for ; Fri, 25 Feb 2005 19:05:34 +0000 (GMT) Received: (qmail 11598 invoked by uid 1112); 25 Feb 2005 19:05:57 -0000 Date: Fri, 25 Feb 2005 14:05:56 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Alan Stange Cc: pgsql-jdbc@postgresql.org, dave.smith@candata.com Subject: Re: setFetchSize question In-Reply-To: <421F4E76.508@rentec.com> Message-ID: References: <421F4E76.508@rentec.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.012 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/204 X-Sequence-Number: 12384 On Fri, 25 Feb 2005, Alan Stange wrote: > conn.setAutoCommit(false); > st.setFetchDirection(ResultSet.FETCH_FORWARD); > st.setFetchSize(1000); > st.executeQuery("select * from foo"); > > which would result in queries to the postgresql server like this: > > DECLARE JDBC_CURS_588 CURSOR FOR select * from foo; fetch forward 1000 > from JDBC_CURS_588; > > In the 8.0 driver I don't see this happening. I see only the "select * > from foo" query in the postgresql server log. > > Is the query result still being sent in batch chunks of 1000 rows, but > using a different mechanism? > Yes, it is still being sent in batches, but it uses the V3 protocol ability to partially execute portals. An Execute message takes a maximum number of rows to return parameter, which is the fetch size. Debugging what the driver is actually doing can be done by adding ?loglevel=2 to the URL which will log all the frontend/backend messages sent/received. Kris Jurka