Re: [RFC] How about changing the default value of defaultRowFetchSize? - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: [RFC] How about changing the default value of defaultRowFetchSize?
Date
Msg-id CADK3HH+xQbJoDXmhQEeXbdR5h+ELV+72oP36PtMgfuzFNDUDVA@mail.gmail.com
Whole thread Raw
In response to [RFC] How about changing the default value of defaultRowFetchSize?  ("Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>)
List pgsql-jdbc
Hi,

It is important to note that fetch size only works when autocommit is off. The implication here is:
 1) fetch size has no bearing whatsoever for most people.
 2) You have to know that fetch size only works in a transaction so you should be sophisticated enough to set it. 
OTOH, I have no objection to setting it to say 100


On 20 October 2016 at 03:55, Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com> wrote:
Hello,

Let me ask your opinion on whether the default value of defaultRowFetchSize can or should be changed.  The current default value is 0, which means the driver fetches all rows at once when the result set is opened.  I'd like to propose changing it to some small positive value because:

* It sometimes causes out-of-memory trouble when users' batch apps process many rows on the client side.  They are often not aware of the fetch size, because they didn't experience the problem with the same app when using Oracle.  Oracle's default fetch size is 10.  They complained about the PostgreSQL's behavior. (OTOH, MySQL's JDBC driver fetches all rows by default like PostgreSQL.)

* If the performance is better when the fetch size is 0, then those who are keen to improve performance can find the method for tuning fetch size.  I think it would be better to make the default setting more friendly for people who aren't so conscious of tuning.


Regards
Takayuki Tsunakawa



--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

pgsql-jdbc by date:

Previous
From: Vladimir Sitnikov
Date:
Subject: Re: Return Codes of BatchUpdateException in PostgreSql 9.6
Next
From: Jeremy Whiting
Date:
Subject: Re: Return Codes of BatchUpdateException in PostgreSql 9.6