Re: Quota query with decent performance?

From: Chester Kustarz <chester(at)arbor(dot)net>
To: Troels Arvin <troels(at)arvin(dot)dk>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Quota query with decent performance?
Date: 2003-11-11 23:49:31
Message-ID: Pine.BSO.4.44.0311111832190.19584-100000@detroit.arbor.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

maybe:

select *
from person
where age <=
(select age from person order by age limit 1 offset 2);

7.20 msec

assuming it does what you want.

On Tue, 11 Nov 2003, Troels Arvin wrote:
> An example of a quota query could be to get the top-3 youngest people from
> a collection of people. The complicated part is that such a query might
> return more than 3 rows in some tie situations.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-11-12 05:17:58 Re: Quota query with decent performance?
Previous Message Josh Berkus 2003-11-11 23:41:34 Re: Quota query with decent performance?