Re: Cursors and Transactions, why?

From: Joe Conway <mail(at)joeconway(dot)com>
To: Eric Ridge <ebr(at)tcdi(dot)com>
Cc: Jan Wieck <JanWieck(at)Yahoo(dot)com>, Pgsql-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Cursors and Transactions, why?
Date: 2004-04-07 04:43:43
Message-ID: 407386FF.9020802@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Eric Ridge wrote:
> On Apr 6, 2004, at 11:54 AM, Jan Wieck wrote:
>> And now you know why they are so good if you don't use all rows. This
>> benefit I think goes away if you use Joe Conway's suggestion of WITH
>> HOLD.
>
> Okay, so WITH HOLD is actually materializing the entire resultset
> (sequential scan or otherwise)? If that's true, you're right, some of
> the benefits do go away.

Keep in mind that the tuplestore stays in memory as long as it fits
within sort_mem kilobytes. And you can do:

set sort_mem to <some_large_number>;

prior to COMMIT, and then

set sort_mem to default;

after COMMIT, as long as you can afford the memory use. A bit ugly, but
it might come in handy ;-)

Joe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Garamond 2004-04-07 04:55:16 Re: SQL trees and other nonsense...
Previous Message Rajat Katyal 2004-04-07 04:38:22 Re: PERFORM statement inside procedure