Skip site navigation (1) Skip section navigation (2)

Re: Huge speed penalty using <>TRUE instead of =FALSE

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-bugs(at)postgresql(dot)org
Cc: Mikael Krantz <mk(at)zigamorph(dot)se>, "Jan-Ivar Mellingen" <jan-ivar(dot)mellingen(at)alreg(dot)no>
Subject: Re: Huge speed penalty using <>TRUE instead of =FALSE
Date: 2009-07-17 12:35:29
Message-ID: 200907171535.29504.peter_e@gmx.net (view raw or flat)
Thread:
Lists: pgsql-bugs
On Friday 17 July 2009 12:45:47 Mikael Krantz wrote:
> It might be that your column may be NULL as well as TRUE or FALSE. I
> am no expert in this matter though.

Nulls also need to be considered when attempting to substitute purportedly 
equivalent clauses.  But in this case it wouldn't actually matter, because

WHERE foo <> TRUE

and

WHERE foo = false

would both omit the row if foo is null.  Both expressions only return true if 
foo has the value "false".  But again, this is data type specific knowledge.


In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2009-07-17 14:11:49
Subject: Re: Huge speed penalty using <>TRUE instead of =FALSE
Previous:From: Peter EisentrautDate: 2009-07-17 10:36:44
Subject: Re: Huge speed penalty using <>TRUE instead of =FALSE

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group