Re: [SQL] Expression transformation curiosity

2003-08-17 Thread Richard Huxton
On Sunday 17 August 2003 16:39, Alexander M. Pravking wrote: > On Sun, Aug 17, 2003 at 11:32:58AM +0100, Richard Huxton wrote: > > Boiling the problem down, I've looked at a clause of the form: > > a OR (b AND c) > > which PG converts to: > > (a OR b) AND (a OR c) > > Is it an artefact of disp

Re: [SQL] Expression transformation curiosity

2003-08-17 Thread Alexander M. Pravking
On Sun, Aug 17, 2003 at 11:32:58AM +0100, Richard Huxton wrote: > I just had a look at EXPLAIN ANALYSE output for an SQL function I'm trying to > write. The WHERE clause wasn't too complex, but the explain output took up a > dozen lines. > > Boiling the problem down, I've looked at a clause of t

Re: [SQL] Expression transformation curiosity

2003-08-17 Thread Tom Lane
Richard Huxton <[EMAIL PROTECTED]> writes: > Boiling the problem down, I've looked at a clause of the form: > a OR (b AND c) > which PG converts to: > (a OR b) AND (a OR c) > Is it an artefact of displaying the EXPLAIN, or is it actually > processed that way? You could see how testing "a" twic

[SQL] Expression transformation curiosity

2003-08-17 Thread Richard Huxton
I just had a look at EXPLAIN ANALYSE output for an SQL function I'm trying to write. The WHERE clause wasn't too complex, but the explain output took up a dozen lines. Boiling the problem down, I've looked at a clause of the form: a OR (b AND c) which PG converts to: (a OR b) AND (a OR c) N