Re: [BUGS] Planner producing 100% duplicate subplans when unneeded

2010-10-04 Thread Tom Lane
Robert Haas writes: > On Mon, Sep 27, 2010 at 5:09 PM, Daniel Grace wrote: >> Is there any chance this might be looked at in a future release? > This is another interesting example of a case where an inlining-type > optimization (which is effectively what's happening here, I think) > turns out t

Re: [BUGS] Planner producing 100% duplicate subplans when unneeded

2010-10-04 Thread Robert Haas
On Mon, Oct 4, 2010 at 4:15 PM, Daniel Grace wrote: > As a theoretical question (I'm not savvy on Postgres's code but might > be intrigued enough to beat on it anyways), is it feasible to do an > additional pass on the query plan that essentially goes: > > - Are these two subplans identical? > - A

Re: [BUGS] Planner producing 100% duplicate subplans when unneeded

2010-10-04 Thread Daniel Grace
As a theoretical question (I'm not savvy on Postgres's code but might be intrigued enough to beat on it anyways), is it feasible to do an additional pass on the query plan that essentially goes: - Are these two subplans identical? - Are they at the same part of the tree? and if both of these cond

Re: [BUGS] Planner producing 100% duplicate subplans when unneeded

2010-10-04 Thread Robert Haas
On Mon, Sep 27, 2010 at 5:09 PM, Daniel Grace wrote: > Is there any chance this might be looked at in a future release? This is another interesting example of a case where an inlining-type optimization (which is effectively what's happening here, I think) turns out to be a negative. We had one a

[BUGS] Planner producing 100% duplicate subplans when unneeded

2010-09-27 Thread Daniel Grace
This is all on Postgres 9.0.0: I'm working on the definition for a view that, as part of its output, includes three columns that each contain a sum of values in a table that are in one of a few different states -- essentially: for each parent, give me the sum of children in the foo state, a second