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

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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-09 21:36:47
Message-ID: b42b73150704091436g7fd1f903q1209218fc5eee88d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 4/9/07, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Merlin Moncure" <mmoncure(at)gmail(dot)com> writes:
> > I have an odd performance issue on 8.2 that I'd thought I'd document
> > here. I have a workaround, but I'm if there is something that I'm not
> > seeing.
>
> It's hard to comment on this without seeing the full details of the view
> and tables. I'm wondering where the SubPlans are coming from, for instance.

ah, it looks like the aggregate is being re-expanded for each field
returned by the aggregate. I notice this for non-trivial record
returning functions also. standard m.o. is to push into a subquery
and expand afterwords.

merlin

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2007-04-09 21:43:42 Re: how to efficiently update tuple in many-to-many relationship?
Previous Message Merlin Moncure 2007-04-09 21:34:39 Re: join to view over custom aggregate seems like it should be faster