pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Alan Stange <stange@rentec.com>
Cc: pgsql-jdbc@postgresql.org
Cc: dave.smith@candata.com
Subject: Re: setFetchSize question
Date: Fri, 25 Feb 2005 14:05:56 -0500 (EST)
Message-ID: <Pine.BSO.4.56.0502251401280.5243@leary.csoft.net> (raw)
In-Reply-To: <421F4E76.508@rentec.com>
References: <421F4E76.508@rentec.com>



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



view thread (4+ messages)  latest in thread

Message-ID: <Pine.BSO.4.56.0502251401280.5243@leary.csoft.net>
Permalink:  ../Pine.BSO.4.56.0502251401280.5243@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.56.0502251401280.5243@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, stange@rentec.com, dave.smith@candata.com
  Subject: Re: setFetchSize question
  In-Reply-To: <Pine.BSO.4.56.0502251401280.5243@leary.csoft.net>
  References: <421F4E76.508@rentec.com> <Pine.BSO.4.56.0502251401280.5243@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox