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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-hackers by date

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