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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Huge speed penalty using <>TRUE instead of =FALSE
Дата
Msg-id 29292.1247840503@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Huge speed penalty using <>TRUE instead of =FALSE  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: Huge speed penalty using <>TRUE instead of =FALSE  (Greg Stark <stark@mit.edu>)
Re: Huge speed penalty using <>TRUE instead of =FALSE  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-bugs
Peter Eisentraut <peter_e@gmx.net> writes:
> ... But again, this is data type specific knowledge.

Actually, now that I think about it, the planner already has
datatype-specific knowledge about boolean equality (see
simplify_boolean_equality).  It would take just a few more lines of code
there to recognize "x <> true" and "x <> false" as additional variant
spellings of the generic "x" or "NOT x" constructs.  Not sure if it's
worth the trouble though; how many people really write such things?

If you really wanted to take it to extremes, you could also reduce
cases like "x > false", but that's starting to get a bit silly.

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Huge speed penalty using <>TRUE instead of =FALSE
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Huge speed penalty using <>TRUE instead of =FALSE