Re: Bad plan for join to aggregate of join. - Mailing list pgsql-performance

From Tom Lane
Subject Re: Bad plan for join to aggregate of join.
Date
Msg-id 3215.1158104550@sss.pgh.pa.us
Whole thread Raw
In response to Bad plan for join to aggregate of join.  (Mischa Sandberg <mischa@ca.sophos.com>)
Responses Re: Bad plan for join to aggregate of join.  (Mischa Sandberg <mischa@ca.sophos.com>)
List pgsql-performance
Mischa Sandberg <mischa@ca.sophos.com> writes:
> can PG see that a join on an grouped-by field
> can be pushed down into the query as an indexable filter?

No.  The GROUP BY serves as a partial optimization fence.  If you're
concerned about the speed of this query, I recommend making a different
view in which 'message' is joined inside the GROUP BY.

            regards, tom lane

pgsql-performance by date:

Previous
From: "Luke Lonergan"
Date:
Subject: Re: Poor performance on seq scan
Next
From: Mark Kirkwood
Date:
Subject: Re: Poor performance on seq scan