From: Dave Cramer <pg@fastcrypt.com>
To: Jorge Solórzano <jorsol@gmail.com>
Cc: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
Cc: Mark Rotteveel <mark@lawinegevaar.nl>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: [RFC] How about changing the default value of defaultRowFetchSize?
Date: Thu, 20 Oct 2016 13:51:51 -0400
Message-ID: <CADK3HH+o7Pd5E-F5ad4kBYkWf6SYm3sPC35v+TUu4eKHCcXrtw@mail.gmail.com> (raw)
In-Reply-To: <CA+cVU8Np4NOsiSBgRcrgPEd3HrQAwspbvszR6Re2EUEZgb-giQ@mail.gmail.com>
References: <0A3221C70F24FB45833433255569204D1F634237@G01JPEXMBYT05>
<3257072a4268ae43c16d341010ca60bd@lawinegevaar.nl>
<CA+cVU8PEUrc7eZcQkrpBTSD6+zTgdr7WP=McnOWx6wBF638sOA@mail.gmail.com>
<CAB=Je-GS1xewXds4d4pj-OtfshrJdVpwbQE+vd9CMCB99s8iOQ@mail.gmail.com>
<CA+cVU8Np4NOsiSBgRcrgPEd3HrQAwspbvszR6Re2EUEZgb-giQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
On 20 October 2016 at 13:30, Jorge Solórzano <jorsol@gmail.com> wrote:
> On Thu, Oct 20, 2016 at 10:33 AM, Vladimir Sitnikov <
> sitnikov.vladimir@gmail.com> wrote:
>
>> Jorge>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.
>>
>> Note that "unset" and "set to 0" might have different meanings for a good
>> (or bad?) reason.
>>
>>
>
> Yes, but "by default" is set to 0, not "unset (null)":
>
>> /**
>> * Default parameter for {@link java.sql.Statement#getFetchSize()}. A
>> value of {@code 0} means
>> * that need fetch all rows at once
>> */
>> DEFAULT_ROW_FETCH_SIZE("defaultRowFetchSize", "0",
>> "Positive number of rows that should be fetched from the database
>> when more rows are needed for ResultSet by each fetch iteration"),
>>
>
> So if the driver internally handle fetch size 0 == fetch size 100, that's
> what i call an hidden inconsistent behavior.
>
> Don't get me wrong, it make sense to switch defaultRowFetchSize to "100",
> but a call to getFetchSize() should be == 100, not 0.
>
As I said 99% of the code out there will never use this as fetch size is
totally useless in autocommit mode. Also an inconsistent behaviour. There a
lots of them.. Setting it internally is fine IMO. I also think it should be
reported as 0 unless the user explicitly sets it. What we do inside the
driver is our business.
Dave Cramer
davec@postgresintl.com
www.postgresintl.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: pg@fastcrypt.com, jorsol@gmail.com, sitnikov.vladimir@gmail.com, mark@lawinegevaar.nl
Subject: Re: [RFC] How about changing the default value of defaultRowFetchSize?
In-Reply-To: <CADK3HH+o7Pd5E-F5ad4kBYkWf6SYm3sPC35v+TUu4eKHCcXrtw@mail.gmail.com>
References: <0A3221C70F24FB45833433255569204D1F634237@G01JPEXMBYT05> <3257072a4268ae43c16d341010ca60bd@lawinegevaar.nl> <CA+cVU8PEUrc7eZcQkrpBTSD6+zTgdr7WP=McnOWx6wBF638sOA@mail.gmail.com> <CAB=Je-GS1xewXds4d4pj-OtfshrJdVpwbQE+vd9CMCB99s8iOQ@mail.gmail.com> <CA+cVU8Np4NOsiSBgRcrgPEd3HrQAwspbvszR6Re2EUEZgb-giQ@mail.gmail.com> <CADK3HH+o7Pd5E-F5ad4kBYkWf6SYm3sPC35v+TUu4eKHCcXrtw@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox