Re: The hidden cost of limit-offset - Mailing list pgsql-general

From David G. Johnston
Subject Re: The hidden cost of limit-offset
Date
Msg-id CAKFQuwbAa0Qgxiy3h55AjnysixgLFZwriQw-MrFC0QTSG9ysAg@mail.gmail.com
Whole thread Raw
In response to The hidden cost of limit-offset  (孙冰 <subi.the.dream.walker@gmail.com>)
Responses Re: The hidden cost of limit-offset  (孙冰 <subi.the.dream.walker@gmail.com>)
List pgsql-general
On Sunday, December 6, 2020, 孙冰 <subi.the.dream.walker@gmail.com> wrote:

The skipped rows by an OFFSET clause have to be computed nevertheless. I am wondering if there could be any chance to improve, since the computation is on the entire rows rather than on the criterial columns.

[...]

I don't understand the postgresql internal, but I suspect such a change may introduce significant work on the planner and executor. From my point view, skipping everything (or expensive ones) except the criteria in the target list would greatly improve the usability of OFFSET, and it is definitely worth the effort.


Given that one can write this with a subquery without much difficulty i’m doubtful that effort spent in this area is going to be particularly valuable.

David J.

pgsql-general by date:

Previous
From: 孙冰
Date:
Subject: The hidden cost of limit-offset
Next
From: Alexander Farber
Date:
Subject: Re: Using a boolean column with IF / THEN