Re: BRIN indexes for MAX, MIN, ORDER BY? - Mailing list pgsql-hackers

From Jeremy Harris
Subject Re: BRIN indexes for MAX, MIN, ORDER BY?
Date
Msg-id 560AD676.6000401@wizmail.org
Whole thread Raw
In response to BRIN indexes for MAX, MIN, ORDER BY?  (Gavin Wahl <gavinwahl@gmail.com>)
Responses Re: BRIN indexes for MAX, MIN, ORDER BY?  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
On 27/09/15 21:58, Gavin Wahl wrote:
> Somewhat harder but still possible would be using BRIN indexes to
> accelerate ORDER BY. This would require a sorting algorithm that can take
> advantage of mostly-sorted inputs. You would sort the page ranges by their
> minimum or maximum value, then feed the sorting algorithm in that order.

An internal merge sort does well with partially-sorted input.
-- 
Cheers,Jeremy





pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: track_commit_timestamp and COMMIT PREPARED
Next
From: Simon Riggs
Date:
Subject: Re: On-demand running query plans using auto_explain and signals