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