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

From Jeremy Harris
Subject Re: EXPLAIN ANALYZE output weird for Top-N Sort
Date
Msg-id 5465E247.3020108@wizmail.org
Whole thread Raw
In response to EXPLAIN ANALYZE output weird for Top-N Sort  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: EXPLAIN ANALYZE output weird for Top-N Sort  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 14/11/14 00:46, Simon Riggs wrote:
> Limit  (cost=.... rows=20 width=175) (actual time=.... rows=20 loops=1)
>    ->  Sort  (cost=.... rows=568733 width=175) (actual time=....
> rows=20 loops=1)
>          Sort Method: top-N heapsort

Going off on a tangent, when I was playing with a merge-sort
implementation I propagated limit information into the sort
node, for a significant win.  Eliding the Limit node gave
a further slight win.

I wasn't convinced the use-case was common enough to justify
the replacement of quicksort (despite having consistently
fewer compares, the merge sort was slightly slower.  I never
understood why) - but I never asked.  Is there any appetite
for supporting alternate sort algorithms?
-- 
Cheers, Jeremy




pgsql-hackers by date:

Previous
From: Kouhei Kaigai
Date:
Subject: Re: using custom scan nodes to prototype parallel sequential scan
Next
From: David Rowley
Date:
Subject: Re: using custom scan nodes to prototype parallel sequential scan