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

Re: Alpha4 Available Now

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Дмитрий Фефелов <fozzy(at)ac-sw(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Josh Berkus <josh(at)agliodbs(dot)com>
Subject: Re: Alpha4 Available Now
Date: 2010-02-27 00:30:16
Message-ID: 8D10DE95-C6FE-416C-9C3F-7BFBCD704B75@seespotcode.net (view raw or flat)
Thread:
Lists: 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




In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2010-02-27 00:36:57
Subject: Re: Hot Standby query cancellation and Streaming Replication integration
Previous:From: Josh BerkusDate: 2010-02-27 00:21:11
Subject: Re: Re: Hot Standby query cancellation and Streaming Replication integration

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