Re: BUG #4264: Optimizer fails to use hash_aggregate when appropriate. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #4264: Optimizer fails to use hash_aggregate when appropriate.
Date
Msg-id 23377.1214427355@sss.pgh.pa.us
Whole thread Raw
In response to BUG #4264: Optimizer fails to use hash_aggregate when appropriate.  ("Scott Carey" <scott@richrelevance.com>)
Responses Re: BUG #4264: Optimizer fails to use hash_aggregate when appropriate.  ("Scott Carey" <scott@richrelevance.com>)
List pgsql-bugs
"Scott Carey" <scott@richrelevance.com> writes:
> The query optimizer fails to use a hash aggregate most of the time.  This is
> an inconsistent behavior.

Hash aggregation is not used when a DISTINCT aggregate is specified.
DISTINCT forces a sort, so there wouldn't be any advantage.

> Of course DB hints would solve this.

No, they wouldn't.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Scott Carey"
Date:
Subject: BUG #4264: Optimizer fails to use hash_aggregate when appropriate.
Next
From: "Clemens Fischer"
Date:
Subject: BUG #4265: PostgreSQL fails to compile