Re: big distinct clause vs. group by

From: Віталій Тимчишин <tivv00(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Uwe Bartels <uwe(dot)bartels(at)gmail(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: big distinct clause vs. group by
Date: 2011-04-25 14:22:23
Message-ID: BANLkTimV3yEF_Dq6rA+m0tfYkFAwwwYNPA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

2011/4/23 Robert Haas <robertmhaas(at)gmail(dot)com>

> On Apr 18, 2011, at 1:13 PM, Uwe Bartels <uwe(dot)bartels(at)gmail(dot)com> wrote:
> > Hi Robert,
> >
> > thanks for your answer.
> > the aggregate function I was talking about is the function I need to use
> for the non-group by columns like min() in my example.
> > There are of course several function to choose from, and I wanted to know
> which causes as less as possible resources.
>
> Oh, I see. min() is probably as good as anything. You could also create a
> custom aggregate that just always returns its first input. I've occasionally
> wished we had such a thing as a built-in.
>
>
I've once done "single" grouping function - it checks that all it's input
values are equal (non-null ones) and returns the value or raises an error if
there are two different values.

Best regards, Vitalii Tymchyshyn

--
Best regards,
Vitalii Tymchyshyn

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2011-04-25 18:06:47 Re: Issue with partition elimination
Previous Message Uwe Bartels 2011-04-24 19:01:36 Re: big distinct clause vs. group by