Hi,
On 2019-05-23 18:31:43 -0400, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
> > It's also noticable that we preposterously assume that the sort actually
> > will return exactly the number of rows in the table, despite being a
> > top-n style sort.
>
> In general, we report nodes below LIMIT with their execute-to-completion
> cost and rowcount estimates. Doing differently for a top-N sort would
> be quite confusing, I should think.
I'm not quite sure that's true. I mean, a top-N sort wouldn't actually
necessarily return all the input rows, even if run to completion. Isn't
that a somewhat fundamental difference?
Greetings,
Andres Freund