Re: [GENERAL] faster SELECT

2004-03-08 Thread Tom Lane
Andrew Rawnsley <[EMAIL PROTECTED]> writes: > It is a fairly well known optimization in Oracle (at least with the > rule-based optimizer, and IIRC non-indexed clauses) to optimize the > WHERE clause right to left. That rule doesn't apply to Postgres, though. If the optimizer does not have any r

Re: [GENERAL] faster SELECT

2004-03-08 Thread Andrew Rawnsley
On Mar 8, 2004, at 5:40 AM, Chris wrote: in a 'SELECT', does postgres read the 'WHERE' condition from left to right. PostgreSQL (SQL in general?) does NOT define evaluation order (unlike programming languages like C). It is a fairly well known optimization in Oracle (at least with the rule-base

Re: [GENERAL] faster SELECT

2004-03-08 Thread Chris
> in a 'SELECT', does postgres read the 'WHERE' condition from left to right. PostgreSQL (SQL in general?) does NOT define evaluation order (unlike programming languages like C). > for example > 1) select ... where a and b; > 2) select ... where b and a; > > 1 and 2 will use the same cpu time

Re: [GENERAL] faster SELECT

2004-03-08 Thread Dexter Tad-y
Sorry for my last blank post, anyway, im not sure this helps but have you tried using EXPLAIN? Dexter Tad-y On Mon, 2004-03-08 at 17:41, sferriol wrote: > hello > in a 'SELECT', does postgres read the 'WHERE' condition from left to right. > > for example > 1) select ... where a and b; > 2) sele

Re: [GENERAL] faster SELECT

2004-03-08 Thread Richard Huxton
On Monday 08 March 2004 09:41, sferriol wrote: > hello > in a 'SELECT', does postgres read the 'WHERE' condition from left to right. > > for example > 1) select ... where a and b; > 2) select ... where b and a; > > 1 and 2 will use the same cpu time or not ? I really wouldn't worry about it, for t

Re: [GENERAL] faster SELECT

2004-03-08 Thread Dexter Tad-y
On Mon, 2004-03-08 at 17:41, sferriol wrote: > hello > in a 'SELECT', does postgres read the 'WHERE' condition from left to right. > > for example > 1) select ... where a and b; > 2) select ... where b and a; > > 1 and 2 will use the same cpu time or not ? > > sylvain -

[GENERAL] faster SELECT

2004-03-08 Thread sferriol
hello in a 'SELECT', does postgres read the 'WHERE' condition from left to right. for example 1) select ... where a and b; 2) select ... where b and a; 1 and 2 will use the same cpu time or not ? sylvain smime.p7s Description: S/MIME Cryptographic Signature