Re: Optimize ORDER BY ... LIMIT - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Optimize ORDER BY ... LIMIT
Date
Msg-id 20060915192342.GB12805@alvh.no-ip.org
Whole thread Raw
In response to Re: Optimize ORDER BY ... LIMIT  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: Optimize ORDER BY ... LIMIT  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Gregory Stark wrote:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
> 
> > I believe a better way to think about this would be as an aggregate that
> > remembers the top N rows.  
> 
> Wouldn't such a thing just be a reimplementation of a tuplestore though? I
> mean, it's storing tuples you feed it, sorting them, and spitting them back
> out in sorted order.

I don't know if this is the same thing you are talking about, but Oleg
talked to me on the conference about "partial sort", which AFAICS it's
about the same thing you are talking about.  I think Teodor submitted a
patch to implement it, which was rejected because of not being general
enough.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Optimize ORDER BY ... LIMIT
Next
From: Bruce Momjian
Date:
Subject: Re: Release notes