Re: Another planner/optimizer question...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: "PGSQL hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Another planner/optimizer question...
Date: 2001-11-01 15:22:35
Message-ID: 21781.1004628155@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
> Is there any way to get PG to know that it only needs to do the
> aggregate once?

It'd probably be possible to look for duplicated aggrefs being assigned
to the same Agg plan node during planning. However, I'm not entirely
convinced that it's worth the trouble --- the individual transition
function calls are not usually all that expensive.

But ... the example you are offering has nothing to do with aggregates.
Subplans are a different and much messier deal. The best I could offer
you (short of a complete redesign of subqueries) would be to not pull up
views that have any subqueries, which would probably be a net loss.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tille, Andreas 2001-11-01 15:24:48 Re: Serious performance problem
Previous Message Tom Lane 2001-11-01 15:14:21 Re: import/export of large objects on server-side