pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mischa Sandberg <mischa@ca.sophos.com>
To: pgsql-performance@postgresql.org
Subject: Re: Bad plan for join to aggregate of join.
Date: Tue, 12 Sep 2006 17:51:27 -0700
Message-ID: <4507560F.9020906@ca.sophos.com> (raw)
In-Reply-To: <3215.1158104550@sss.pgh.pa.us>
References: <821wqiy0oc.fsf@mid.bfk.de>
	<45071FCC.8090509@ca.sophos.com>
	<3215.1158104550@sss.pgh.pa.us>

Tom Lane wrote:
> 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.

Thanks.



view thread (3+ messages)

Message-ID: <4507560F.9020906@ca.sophos.com>
Permalink:  ../4507560F.9020906@ca.sophos.com/
Also on:    postgresql.org/message-id/4507560F.9020906@ca.sophos.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: mischa@ca.sophos.com
  Subject: Re: Bad plan for join to aggregate of join.
  In-Reply-To: <4507560F.9020906@ca.sophos.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox