Re: distinct vs group by - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: distinct vs group by
Date
Msg-id 20050129222306.GB14571@wolff.to
Whole thread Raw
In response to distinct vs group by  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
List pgsql-novice
On Fri, Jan 28, 2005 at 02:35:21 -0800,
  Ron Mayer <rm_pg@cheapcomplexdevices.com> wrote:
>
> Should the expressions
>   select distinct x from t
> and
>   select          x from t group by x
> have the same effect?
>
> It seems the optimizer sometimes chooses different plans for those
> expressions.   Could the select distinct have used the slightly
> faster hash aggregate?

I don't think select distinct can use hash aggregate plans.

pgsql-novice by date:

Previous
From: Ron Mayer
Date:
Subject: distinct vs group by
Next
From: Tom Lane
Date:
Subject: Re: distinct vs group by