Re: Bad plan for join to aggregate of join.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: mischa(at)ca(dot)sophos(dot)com
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Bad plan for join to aggregate of join.
Date: 2006-09-12 23:42:30
Message-ID: 3215.1158104550@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Mischa Sandberg <mischa(at)ca(dot)sophos(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Mark Kirkwood 2006-09-13 00:14:52 Re: Poor performance on seq scan
Previous Message Luke Lonergan 2006-09-12 22:18:11 Re: Poor performance on seq scan