Re: EXPLAIN ANALYZE output weird for Top-N Sort - Mailing list pgsql-hackers

From David G Johnston
Subject Re: EXPLAIN ANALYZE output weird for Top-N Sort
Date
Msg-id 1415929823999-5826938.post@n5.nabble.com
Whole thread Raw
In response to Re: EXPLAIN ANALYZE output weird for Top-N Sort  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: EXPLAIN ANALYZE output weird for Top-N Sort  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane-2 wrote
> [ shrug... ]  The estimated value is the planner's estimate of what would
> happen *if you ran the node to completion*, which in practice doesn't
> happen because of the LIMIT.  

I don't see how a sort node cannot run to completion...raising the thought
that the "actual" row count should not be 10 but should equal whatever the
input row count size is.

I guess there may be some efficient algorithms and/or inputs that make a
sort go slower or faster but ultimately the node would have to ensure that
every input row has been sorted before it can return control to its parent
node.  If the parent only cares about the first 10 rows of the now-sorted
relation the sort node doesn't know or care.

David J.




--
View this message in context:
http://postgresql.nabble.com/EXPLAIN-ANALYZE-output-weird-for-Top-N-Sort-tp5826922p5826938.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: EXPLAIN ANALYZE output weird for Top-N Sort
Next
From: David Rowley
Date:
Subject: Re: using custom scan nodes to prototype parallel sequential scan