Re: BRIN indexes for MAX, MIN, ORDER BY?

Jeremy Harris <jgh@wizmail.org>

From: Jeremy Harris <jgh@wizmail.org>
To: pgsql-hackers@postgresql.org
Date: 2015-09-29T18:20:38Z
Lists: 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