Re: Out of memory error on huge resultset

Поиск
Список
Период
Сортировка
От Nic Ferrier
Тема Re: Out of memory error on huge resultset
Дата
Msg-id 87d6qgzc51.fsf@pooh-sticks-bridge.tapsellferrier.co.uk
обсуждение исходный текст
Ответ на Re: Out of memory error on huge resultset  (Nic Ferrier <nferrier@tapsellferrier.co.uk>)
Список pgsql-jdbc
Nic Ferrier <nferrier@tapsellferrier.co.uk> writes:

> Basically, I like your solution: use setFetchSize to control when a
> cursor is used.
> 

I decided the quickest short term thing to do was make everything go
through a cursor and see what effect that has.

The default fetch size is 0 and guess what that means to the FETCH
command? That's right: get everything.

So I'm simply transforming querys from:

   SELECT x FROM y WHERE z;


into
   DECLARE jdbcXX CURSOR FOR $query ;    FETCH FORWARD $fetchSize jdbcXX;


I'll then alter the code to deal with the necessary auto-fetching
when the cache gets low.

I think this is a pretty good trade off between what we've got and
the need not to trash the VM with a gazillion row query.


I haven't quite got it working yet, but I've only been hacking for a
couple of hours (and I'm not very quick  /8-).


Nic



В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Anoter JDBC Error
Следующее
От: Barry Lind
Дата:
Сообщение: Re: Out of memory error on huge resultset