Re: [HACKERS] Re-ordering of OR conditions

2007-02-09 Thread Simon Riggs
On Fri, 2007-02-09 at 11:46 -0500, Tom Lane wrote: > "Jim Nasby" <[EMAIL PROTECTED]> writes: > > IF I run the following with the a < 2900 condition first, the more > > expensive EXISTS only gets executed when needed, but if I change the > > order of the OR's, the EXISTS is always executed. It w

Re: [HACKERS] Re-ordering of OR conditions

2007-02-09 Thread Jim Nasby
On Feb 9, 2007, at 10:46 AM, Tom Lane wrote: "Jim Nasby" <[EMAIL PROTECTED]> writes: IF I run the following with the a < 2900 condition first, the more expensive EXISTS only gets executed when needed, but if I change the order of the OR's, the EXISTS is always executed. It would be good if the o

Re: [HACKERS] Re-ordering of OR conditions

2007-02-09 Thread Tom Lane
"Jim Nasby" <[EMAIL PROTECTED]> writes: > IF I run the following with the a < 2900 condition first, the more > expensive EXISTS only gets executed when needed, but if I change the > order of the OR's, the EXISTS is always executed. It would be good if > the optimizer could re-order the OR con

[HACKERS] Re-ordering of OR conditions

2007-02-08 Thread Jim Nasby
IF I run the following with the a < 2900 condition first, the more expensive EXISTS only gets executed when needed, but if I change the order of the OR's, the EXISTS is always executed. It would be good if the optimizer could re-order the OR conditions based on estimated cost (granted, this