Re: setFetchSize question

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: setFetchSize question
Дата
Msg-id Pine.BSO.4.56.0502251401280.5243@leary.csoft.net
обсуждение исходный текст
Ответ на setFetchSize question  (Alan Stange <stange@rentec.com>)
Список pgsql-jdbc

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

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Where are we on stored procedures?
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Statement level transactions