Re: DONT_CARE Aggregate

From: Marti Raudsepp <marti(at)juffo(dot)org>
To: Robert James <srobertjames(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: DONT_CARE Aggregate
Date: 2012-12-20 17:24:35
Message-ID: CABRT9RDhjKr4+PmMj+vwCh51oXWaf2axR9U8GO3uQpp31QehbA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Dec 20, 2012 at 3:28 AM, Robert James <srobertjames(at)gmail(dot)com> wrote:
> Is there an aggregate that will return an arbitrary instance? That is,
> not necessarily the max or min, just any one? (Which might perform
> better than max or min)
>
> More importantly:
> Is there one which will return an arbitrary instance as long as it's not NULL

There's an extension on PGXN which implements first()/last()
aggregates in C: http://pgxn.org/dist/first_last_agg/

It should be slightly faster than min()/max(), but the difference is
probably not significant in more complex queries.

Regards,
Marti

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-12-20 17:36:47 Re: DONT_CARE Aggregate
Previous Message Chris Curvey 2012-12-20 17:11:26 Re: DONT_CARE Aggregate