Re: Optimizer Hint, to ignore limit and offset in optimizer plan

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Martin Handsteiner <martin(dot)handsteiner(at)sibvisions(dot)com>
Cc: "pgsql-sql(at)lists(dot)postgresql(dot)org" <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Re: Optimizer Hint, to ignore limit and offset in optimizer plan
Date: 2020-06-26 23:59:54
Message-ID: 20200626235954.GA3324@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)momjian(dot)us> https://momjian.us
EnterpriseDB https://enterprisedb.com

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Simon Riggs 2020-06-27 11:08:49 Re: Optimizer Hint, to ignore limit and offset in optimizer plan
Previous Message Pavel Stehule 2020-06-26 09:01:55 Re: Optimizer Hint, to ignore limit and offset in optimizer plan