Re: Optimizer & boolean syntax - Mailing list pgsql-hackers

From Stephan Szabo
Subject Re: Optimizer & boolean syntax
Date
Msg-id 20021121133645.O99444-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Optimizer & boolean syntax  (Daniele Orlandi <daniele@orlandi.com>)
List pgsql-hackers
On Thu, 21 Nov 2002, Daniele Orlandi wrote:

> Are those two syntaxes eqivalent ?
>
> select * from users where monitored;
> select * from users where monitored=true;
>
> If the answer is yes, the optimimer probably doesn't agree with you :)

That depends on the definition of equivalent.  They presumably give the
same answer (I'm assuming monitored is a boolean), but the latter has
something that's considered an indexable condition and I believe the
former does not (even with enable_seqscan=off the former syntax
appears to give a sequence scan, usually a good sign it's not considered
indexable).



pgsql-hackers by date:

Previous
From: Robert Treat
Date:
Subject: Re: Optimizer & boolean syntax
Next
From: "scott.marlowe"
Date:
Subject: Re: [GENERAL] Bug with sequence