Re: Optimizer Hint, to ignore limit and offset in optimizer plan - Mailing list pgsql-sql

From Bruce Momjian
Subject Re: Optimizer Hint, to ignore limit and offset in optimizer plan
Date
Msg-id 20200626235954.GA3324@momjian.us
Whole thread Raw
In response to Optimizer Hint, to ignore limit and offset in optimizer plan  (Martin Handsteiner <martin.handsteiner@sibvisions.com>)
List pgsql-sql
On Fri, Jun 26, 2020 at 08:49:19AM +0000, Martin Handsteiner wrote:
> Hello,
> 
>  
> 
> I’m aware, that taking limit and offset into account of optimizer plan is not a
> bug.
> 
> Nevertheless it is very often an unwanted feature.
> 
> As the postgres db has the issue with not supporting cursors over commit/
> rollback, it is necessary to use the limit and offset mechanism.

Uh, have you considered WITH HOLD cursors:

    WITH HOLD specifies that the cursor can continue to be used after the
    transaction that created it successfully commits.  WITHOUT HOLD
    specifies that the cursor cannot be used outside of the transaction that
    created it. If neither WITHOUT HOLD nor WITH HOLD is specified, WITHOUT
    HOLD is the default.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EnterpriseDB                             https://enterprisedb.com

  The usefulness of a cup is in its emptiness, Bruce Lee




pgsql-sql by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Optimizer Hint, to ignore limit and offset in optimizer plan
Next
From: Simon Riggs
Date:
Subject: Re: Optimizer Hint, to ignore limit and offset in optimizer plan