Re: Alpha4 Available Now - Mailing list pgsql-hackers

From Michael Glaesemann
Subject Re: Alpha4 Available Now
Date
Msg-id 8D10DE95-C6FE-416C-9C3F-7BFBCD704B75@seespotcode.net
Whole thread Raw
In response to Re: Alpha4 Available Now  (Дмитрий Фефелов <fozzy@ac-sw.com>)
Responses Re: Alpha4 Available Now  (Дмитрий Фефелов <fozzy@ac-sw.com>)
List pgsql-hackers
On Feb 26, 2010, at 0:55 , Дмитрий Фефелов wrote:

> http://developer.postgresql.org/pgdocs/postgres/release-9-0.html
>
> Performance section:
>
>> Simplify the forms foo <> true and foo <> false to foo = false and
>> foo = true during query optimization.
>
> Will it work correct;ly when foo is NULL?

It shouldn't have any effect: NULL <> anything and NULL = anything is
NULL

SELECT arg1, arg2,       (arg1 <> arg2) AS "arg1 <> arg2",       (arg1 = arg2) AS "(arg1 = arg2)"  FROM (VALUES (TRUE,
TRUE),(TRUE, FALSE),               (FALSE, TRUE), (FALSE, FALSE),               (NULL, TRUE), (NULL, FALSE)) AS bools
(arg1,arg2)  ORDER BY arg1, arg2; 
  arg1  | arg2 | arg1 <> arg2 | (arg1 = arg2)
--------+------+--------------+--------------- f      | f    | f            | t f      | t    | t            | f t
|f    | t            | f t      | t    | f            | t (null) | f    | (null)       | (null) (null) | t    | (null)
    | (null) 
(6 rows)

Michael Glaesemann
grzm seespotcode net





pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Re: Hot Standby query cancellation and Streaming Replication integration
Next
From: Michael Glaesemann
Date:
Subject: Re: Correcting Error message