pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dave@micro-automation.net
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: setFetchSize()
Date: Thu, 17 Jul 2003 22:54:20 -0400
Message-ID: <16969.1058496860@sss.pgh.pa.us> (raw)
In-Reply-To: <1058476359.1574.3.camel@localhost.localdomain>
References: <3F16D2C9.3010808@sysd.com>
	<3F16D677.3010300@openratings.com>
	<20030717140110.52ca5fe2.felipes@ritterdosreis.br>
	<3F16D9DF.6050900@openratings.com>
	<20030717141903.2cf411e2.felipes@ritterdosreis.br>
	<3F16DC24.5020509@openratings.com>
	<1058476359.1574.3.camel@localhost.localdomain>

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



view thread (40+ messages)  latest in thread

Message-ID: <16969.1058496860@sss.pgh.pa.us>
Permalink:  ../16969.1058496860@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16969.1058496860@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, Dave@micro-automation.net
  Subject: Re: setFetchSize()
  In-Reply-To: <16969.1058496860@sss.pgh.pa.us>
  References: <3F16D2C9.3010808@sysd.com> <3F16D677.3010300@openratings.com> <20030717140110.52ca5fe2.felipes@ritterdosreis.br> <3F16D9DF.6050900@openratings.com> <20030717141903.2cf411e2.felipes@ritterdosreis.br> <3F16DC24.5020509@openratings.com> <1058476359.1574.3.camel@localhost.localdomain> <16969.1058496860@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox