Re: join to view over custom aggregate seems like it should be faster

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
Cc: "PostgreSQL Performance" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: join to view over custom aggregate seems like it should be faster
Date: 2007-04-10 17:03:06
Message-ID: 27416.1176224586@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Merlin Moncure" <mmoncure(at)gmail(dot)com> writes:
> For some reason, I can't get the index to be used on the table sitting
> under a view during a join, even though it should be, or at least it
> seems....

Nope, that's not going to work, because the aggregate keeps the subquery
from being flattened into the upper query, which is what would have to
happen for a nestloop-with-inner-indexscan join to be considered.
AFAICS you've got to structure it so that the aggregation happens above
the join.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Merlin Moncure 2007-04-10 17:53:02 Re: join to view over custom aggregate seems like it should be faster
Previous Message Tom Lane 2007-04-10 16:46:28 Re: DELETE with filter on ctid