Robert Haas writes:
> On Thu, Jul 8, 2010 at 3:05 PM, Tom Lane wrote:
>> Right, but look for example at the logic involved with the current outer
>> join transformation identity #3, which can't be applied unless the join
>> predicate is strict for the left-hand side. We avoid doing the dogwork
>
On Thu, Jul 8, 2010 at 3:05 PM, Tom Lane wrote:
> Robert Haas writes:
>> On Thu, Jul 8, 2010 at 2:48 PM, Tom Lane wrote:
>>> I think it might work out better if you ask "what
>>> additional conditions are needed in order to prove that this inner join
>>> can commute with this left join", and the
I think it might work out better if you ask "what
> additional conditions are needed in order to prove that this inner join
> can commute with this left join", and then work at being able to prove
> that. (It's entirely likely that the planner isn't currently gathering
> the right information fo
Robert Haas writes:
> On Thu, Jul 8, 2010 at 2:48 PM, Tom Lane wrote:
>> I think it might work out better if you ask "what
>> additional conditions are needed in order to prove that this inner join
>> can commute with this left join", and then work at being able to prove
>> that. (It's entirely
On Thu, Jul 8, 2010 at 2:48 PM, Tom Lane wrote:
> Robert Haas writes:
>> Consider:
>
>> SELECT * FROM foo LEFT JOIN (bar JOIN baz ON bar.y = baz.y) ON foo.x = bar.x;
>
>> If foo is itty bitty and bar and baz are enormous, it would be nice to
>> start by joining foo to bar and then joining the res
Robert Haas writes:
> Consider:
> SELECT * FROM foo LEFT JOIN (bar JOIN baz ON bar.y = baz.y) ON foo.x = bar.x;
> If foo is itty bitty and bar and baz are enormous, it would be nice to
> start by joining foo to bar and then joining the result to baz, but
> that's not legal. However, if bar (y)
So I sat down to work on some code to do inner join removal, and
quickly got stuck. As a first step, I wanted to write some code that
would identify inner joins that could be treated as LEFT JOINs if we
so chose. Consider:
SELECT 1 FROM foo, bar WHERE foo.x = bar.x;
If it so happens that there