Re: Optimize ORDER BY ... LIMIT

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Optimize ORDER BY ... LIMIT
Date: 2006-09-15 19:23:42
Message-ID: 20060915192342.GB12805@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gregory Stark wrote:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2006-09-15 19:30:37 Re: Release notes
Previous Message Gregory Stark 2006-09-15 19:22:50 Re: Optimize ORDER BY ... LIMIT