Re: setFetchSize() and preferQueryMode incompatible?

Поиск
Список
Период
Сортировка
От Vladimir Sitnikov
Тема Re: setFetchSize() and preferQueryMode incompatible?
Дата
Msg-id CAB=Je-EvOXHcoQcH=xxXQdru_cLbr23Ad3_1qSSWatmpvAYEsQ@mail.gmail.com
обсуждение исходный текст
Ответ на setFetchSize() and preferQueryMode incompatible?  (Alan Stange <stange@rentec.com>)
Список pgsql-jdbc
Hi,

TL;DR: it works as expected/designed.

Alan>extendedForPrepared to avoid the multiple round trips to the server.  
The default setting is a significant performance impact if there is any
meaningful network latency

Would you please elaborate and/or provide a test case for the "performance impact"?
Note: you might want to collect some trace logs (loggerLevel=TRACE&loggerFile=pgjdbc-trace.log) in order to count the roundtrips.

Alan>The fetch size will not be respected with the
preferQueryMode property present

That setting means pgjdbc would use "Simple Query" to execute con.createStatement() kind of statements.
"Simple query" does not support portals, and there is no room to specify "fetch size".
It is just <<'Q' len:Int32 text:string>> message to the server, and it always replies with full set of rows.

In case you absolutely need to use preferQueryMode=extendedForPrepared, you can make fetchsize to work by using con.prepareStatement(...)

Vladimir

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

Предыдущее
От: Alan Stange
Дата:
Сообщение: setFetchSize() and preferQueryMode incompatible?
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: ResultSet storing all rows with defaulftFetchSize to 5000