Re: Autocommit, isolation level, and vacuum behavior

Поиск
Список
Период
Сортировка
От Tomasz Ostrowski
Тема Re: Autocommit, isolation level, and vacuum behavior
Дата
Msg-id 48CA0DC8.3040603@batory.org.pl
обсуждение исходный текст
Ответ на Re: Autocommit, isolation level, and vacuum behavior  (Jack Orenstein <jack.orenstein@hds.com>)
Ответы Re: Autocommit, isolation level, and vacuum behavior  (Jack Orenstein <jack.orenstein@hds.com>)
Список pgsql-general
On 2008-09-11 18:03, Jack Orenstein wrote:

>> When you do:
>> result = query("select something from sometable")
>> then all rows of a result will be cached by a client program.
>
> I am very sure this is not happening. Maybe some rows are being
> cached (specifying fetch size), but certainly not all of them. It
> used to, with older drivers, (7.4?) but I've been using 8.1 drivers
> (at least) for a long time. Maybe some result set options you're
> using cause such memory usage?

Wanna bet?

http://jdbc.postgresql.org/documentation/83/query.html#query-with-cursor
| There a number of restrictions which will make the driver silently
| fall back to fetching the whole ResultSet at once. (...) The
| Connection must not be in autocommit mode. The backend closes cursors
| at the end of transactions, so in autocommit mode the backend will
| have closed the cursor before anything can be fetched from it.

So, when you turn on autocommit then it is caching it all. Fetch size is
ignored.

Regards
Tometzky
--
...although Eating Honey was a very good thing to do, there was a
moment just before you began to eat it which was better than when you
were...
                                                      Winnie the Pooh

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

Предыдущее
От: Artacus
Дата:
Сообщение: If there were no OS databases
Следующее
От: Tomasz Ostrowski
Дата:
Сообщение: Re: Autocommit, isolation level, and vacuum behavior