Re: Alpha4 Available Now
От | Michael Glaesemann |
---|---|
Тема | Re: Alpha4 Available Now |
Дата | |
Msg-id | 8D10DE95-C6FE-416C-9C3F-7BFBCD704B75@seespotcode.net обсуждение исходный текст |
Ответ на | Re: Alpha4 Available Now (Дмитрий Фефелов <fozzy@ac-sw.com>) |
Ответы |
Re: Alpha4 Available Now
|
Список | 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 по дате отправления: