Re: setFetchSize() - Mailing list pgsql-jdbc

From Tom Lane
Subject Re: setFetchSize()
Date
Msg-id 16969.1058496860@sss.pgh.pa.us
Whole thread Raw
In response to Re: setFetchSize()  (Dave Cramer <Dave@micro-automation.net>)
Responses Re: setFetchSize()  (Dave Cramer <Dave@micro-automation.net>)
Re: setFetchSize()  (Dmitry Tkach <dmitry@openratings.com>)
List pgsql-jdbc
Dave Cramer <Dave@micro-automation.net> writes:
> This isn't true any more, the backend supports with hold now, so you can
> declare a cursor outside a transaction

However, if the problem is that the query result is too large to hold in
memory, then a WITH HOLD cursor is a terrible solution.  You are simply
moving the problem of coping with the fully-materialized query result
out of the client and into the backend.  Admittedly the backend is
probably better able to cope than the client (at least it knows how to
spill rows to disk...), but if you are trying to get good performance
on huge result sets you do not want to use a held cursor, any more than
you want to suck the whole result into client memory.

            regards, tom lane

pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: setFetchSize()
Next
From: Barry Lind
Date:
Subject: Re: Prepared Statements