Re: Top-N sorts in EXPLAIN, row count estimates, and parallelism - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Top-N sorts in EXPLAIN, row count estimates, and parallelism
Date
Msg-id 20190523223654.tpkigtzavpjxluj4@alap3.anarazel.de
Whole thread Raw
In response to Re: Top-N sorts in EXPLAIN, row count estimates, and parallelism  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

On 2019-05-23 18:31:43 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.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



pgsql-hackers by date:

Previous
From: Mark Dilger
Date:
Subject: Re: ClosePipeStream failure ignored in pg_import_system_collations
Next
From: Thomas Munro
Date:
Subject: Re: Question about BarrierAttach spinlock