Re: [PERFORM] Outer joins and equivalence

2008-06-02 Thread Simon Riggs
On Mon, 2008-06-02 at 18:10 +0100, Simon Riggs wrote: > On Tue, 2008-05-27 at 17:43 -0400, Tom Lane wrote: > > Simon Riggs <[EMAIL PROTECTED]> writes: > > > I have a complex query where making a small change to the SQL increases > > > run-time by > 1000 times. > > > > > The first SQL statement is

Re: [PERFORM] Outer joins and equivalence

2008-06-02 Thread Simon Riggs
On Tue, 2008-05-27 at 17:43 -0400, Tom Lane wrote: > Simon Riggs <[EMAIL PROTECTED]> writes: > > I have a complex query where making a small change to the SQL increases > > run-time by > 1000 times. > > > The first SQL statement is of the form > > > A JOIN B ON (a.id = b.id) LEFT JOIN C ON (a.id

Re: [PERFORM] Outer joins and equivalence

2008-05-28 Thread Simon Riggs
On Wed, 2008-05-28 at 11:45 +0100, Matthew Wakeling wrote: > On Tue, 27 May 2008, Simon Riggs wrote: > > I do recognise that we would *not* be able to deduce this form of SQL > > > > A JOIN B ON (a.id = c.id) LEFT JOIN C ON (b.id = c.id) > > Surely that would not be valid SQL? You are right, but

Re: [PERFORM] Outer joins and equivalence

2008-05-28 Thread Matthew Wakeling
On Tue, 27 May 2008, Simon Riggs wrote: I do recognise that we would *not* be able to deduce this form of SQL A JOIN B ON (a.id = c.id) LEFT JOIN C ON (b.id = c.id) Surely that would not be valid SQL? Matthew -- Psychotics are consistently inconsistent. The essence of sanity is to be inconsi

Re: [PERFORM] Outer joins and equivalence

2008-05-27 Thread Tom Lane
Simon Riggs <[EMAIL PROTECTED]> writes: > I have a complex query where making a small change to the SQL increases > run-time by > 1000 times. > The first SQL statement is of the form > A JOIN B ON (a.id = b.id) LEFT JOIN C ON (a.id = c.id) > and the second is like this > A JOIN B ON (a.id = b.

[PERFORM] Outer joins and equivalence

2008-05-27 Thread Simon Riggs
I have a complex query where making a small change to the SQL increases run-time by > 1000 times. The first SQL statement is of the form A JOIN B ON (a.id = b.id) LEFT JOIN C ON (a.id = c.id) and the second is like this A JOIN B ON (a.id = b.id) LEFT JOIN C ON (b.id = c.id) the only differen