Subject RE: [Firebird-Java] Fetch size questions
Author Rick DeBay
OK, ignore my post. I didn't know what isc_dsql_fetch was, so I wanted
to make sure the fetch size was behaving like I expected it to.

> Probably I was not clear. Statement.setFetchSize according to the
specs should tell the driver how many _rows_ should be fetched. However
Firebird does not care about this, so we can control this only
approximately.

-----Original Message-----
From: Rick DeBay
Sent: Friday, July 30, 2004 10:00 AM
To: Firebird-Java@yahoogroups.com
Subject: [Firebird-Java] Fetch size questions

> No idea. Fetch size only tells driver how many isc_dsql_fetch calls
should be made to fill the internal buffer. You can set it to 1 and this
will
guarantee that isc_dsql_fetch will be called only once.

If I call statement.setFetchSize(20), then Firebird will send at least
twenty records, but probably more because it will try to fill every
network packet. Is this correct?

-----Original Message-----
From: Roman Rokytskyy [mailto:rrokytskyy@...]
Sent: Friday, July 30, 2004 5:11 AM
To: Firebird-Java@yahoogroups.com
Subject: Re: [Firebird-Java] Re: Speed problem retrieving 50,000 rows...

> Yes, the connection is in auto-commit mode... some things have
> changed a bit and the time taken is now 4.8 seconds. When I turn off
> autocommit, time is 2.0 seconds.
> While this is a vast improvement, this part of our code is executed
> often, so 2 seconds is noticeable...

Do you want to say that you execute the SELECT statement but you need
only
few entries from it? Then you better use SELECT FIRST x [SKIP y]
statement.

But if at the end you fetch the complete result locally, you will have
to
spend that 2.0 seconds sooner or later. Or do I miss something?

> can you tell me more about the (default) fetch size (or a URL
describing
> it)?

There is no way to specify the default fetch size in the URL. The
default
value is just a number, it has little sense when the record size is not
taken into account. It makes also little sense to set it for the
complete
connection, since different queries will be executed.

> I saw your follow-up which said the requested fetch size is not
> guaranteed, but maybe I can at least tweak it a little...?

No idea. Fetch size only tells driver how many isc_dsql_fetch calls
should
be made to fill the internal buffer. You can set it to 1 and this will
guarantee that isc_dsql_fetch will be called only once.

Roman





Yahoo! Groups Links









Yahoo! Groups Links