Re: [PATCH] Make skipped sort explicit in EXPLAIN ANALYZE

Peter Geoghegan <peter@2ndquadrant.com>

From: Peter Geoghegan <peter@2ndquadrant.com>
To: Marti Raudsepp <marti@juffo.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2012-05-25T14:39:24Z
Lists: pgsql-hackers
On 25 May 2012 15:19, Marti Raudsepp <marti@juffo.org> wrote:
> I understand where you're coming from, but personally I think the
> current output is more confusing: "Gee Postgres is stupid, it's
> sorting when there's nothing to sort!"
>
> But let's wait for a third opinion.

I agree with Tom. The idea that you "sort when there's nothing to
sort" is not confusing. Textbook implementations of recursive sorting
algorithms explicitly have a notion of sorting one element, by simply
recognising that one element must already be sorted. For example, look
at the quicksort pseudocode here:

http://en.wikipedia.org/wiki/Quicksort

-- 
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services