Re: [RFC] How about changing the default value of defaultRowFetchSize?

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Mark Rotteveel <mark(at)lawinegevaar(dot)nl>
Cc: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: [RFC] How about changing the default value of defaultRowFetchSize?
Date: 2016-10-20 17:53:59
Message-ID: CADK3HHJPyAtomOsds9CbxcFQjyN3t3Sc25vMEHXPA6PXDQwwZg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 20 October 2016 at 13:51, Mark Rotteveel <mark(at)lawinegevaar(dot)nl> wrote:

> On 20-10-2016 17:59, Jorge Solórzano wrote:
>
>> On Thu, Oct 20, 2016 at 6:53 AM, Mark Rotteveel <mark(at)lawinegevaar(dot)nl
>> <mailto:mark(at)lawinegevaar(dot)nl>> wrote:
>>
>>
>> In other words, PostgreSQL JDBC could
>> ​​
>> leave the default at 0, but then use a default fetch size.
>>
>>
>> ​
>> That's seems wrong, the Fetch Size should be correctly reported, the
>> defaultRowFetchSize property can be changed to 100 but a call to
>> getFetchSize() should return 100 not 0.
>>
>> Based on the driver docs:
>> "defaultRowFetchSize: Default parameter for
>> java.sql.Statement#getFetchSize(). A value of 0 means that need fetch
>> all rows at once"
>>
>> The value of 0 should be used to fetch all rows, if we ​leave the
>> default at 0 and handle internally that as 100 (and reporting it as 0)
>> it is a wrong behavior.
>>
>
> My reply was purely from the perspective of the JDBC specification, not
> how the PostgreSQL JDBC driver currently implements it.
>
> According to the JDBC specification:
>
> "The methods getFetchDirection and getFetchSize return the current value
> of the hints. If either of these methods is called before the corresponding
> setter method has been called, the value returned is
> implementation-defined."
>
> In other words, the default fetch size is implementation defined,
> furthermore the javadoc of Statement.setFetchSize implies that setting it
> to value 0 will revert to the default (whatever that is).
>

Even more of an argument to leave it returning 0 unless it is explicitly set

Dave Cramer

davec(at)postgresintl(dot)com
www.postgresintl.com

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Mark Rotteveel 2016-10-20 17:55:51 Re: [RFC] How about changing the default value of defaultRowFetchSize?
Previous Message Mark Rotteveel 2016-10-20 17:51:59 Re: [RFC] How about changing the default value of defaultRowFetchSize?