Re: Disk buffering of resultsets

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Disk buffering of resultsets
Date: 2014-09-21 07:06:44
Message-ID: lvlte4$jn$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Enrico Olivelli - Diennea wrote on 19.09.2014 12:44:
> Hi,
>
> we are moving from Oracle to PostgreSQL and we hit a serious
> problem.
>
> When executing a query with a large result set your driver loads each
> record in memory and this is a blocking problem for us.
>
> The work-around is to use server-side cursors
> (http://jdbc.postgresql.org/documentation/head/query.html) but in
> order to do this we have to change autocommit mode of the transaction
> and this will change transaction semantics of out code.
>
> Many JDBC drivers provide some swap-to-disk function in oredr to deal
> with huge result sets
>
> Something like “if we are loading in RAM more than X MBs than swap on
> disk”
>
> or “if we are loading in RAM more than X rows than swap on disk”
> (more simple to implement)
>

Wouldn't it make more sense to allow for a non-buffered result when using auto-commit
(something like "bufferResults=false") instead?

Or is that technically not possible due to the Postgres wire-protocol?

Thomas

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Craig Ringer 2014-09-21 07:18:41 Re: Disk buffering of resultsets
Previous Message Lussier, Denis 2014-09-21 03:24:29 Re: Disk buffering of resultsets