ResultSet implementation

Поиск
Список
Период
Сортировка
Искать

ResultSet implementation

От:
"Sean Devlin" <seandevlin37@hotmail.com>
Дата:
Hello,

I would like to know if PG's implementation of ResultSet caches all or only 
some of the rows returned from a query.  If the RS implementation does fetch 
blocks of data as it iterates, how many rows are retrieved at a time?.. or 
does this number fluctuate? etc.

thanks,

Sean

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

Re: ResultSet implementation

От:
Nic Ferrier <nferrier@tapsellferrier.co.uk>
Дата:
"Sean Devlin"  writes:

> Hello,
> 
> I would like to know if PG's implementation of ResultSet caches all or only
> some of the rows returned from a query.  If the RS implementation does fetch
> blocks of data as it iterates, how many rows are retrieved at a time?.. or
> does this number fluctuate? etc.

Normally pg-jdbc fetches ALL the results from a query and caches
them. The reason it does that is because it's the best option most of
the time.

With the driver in CVS it is possible to alter that behaviour. Just
turn off auto-commit and set the fetch size to the number of rows you
want cached.

When you do that the driver switches to a cursor querying
mechanism.

This is not in the released driver yet. I think it's planned for 7.4
but one of the core JDBC hackers will be able to confirm that.


Nic
FAQ