Re: BUG #18442: Unnecessary Sort operator in indexScan Plan

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #18442: Unnecessary Sort operator in indexScan Plan
Дата
Msg-id 2909005.1713752742@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #18442: Unnecessary Sort operator in indexScan Plan  (David Rowley <dgrowleyml@gmail.com>)
Ответы Re: BUG #18442: Unnecessary Sort operator in indexScan Plan  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-bugs
David Rowley <dgrowleyml@gmail.com> writes:
> Couldn't strict equality conditions be handled using the same method
> that we use to handle an Eclass with two distinct Consts. e.g a = 1
> and a=b and b=2?

Perhaps, but it'd be a bit odd and confusing to treat two NULLs as
distinct rather than equal.

On the whole I'm disinclined to add complexity around this.  My gut
says there are more semantic gotchas than this one, and I think the
use-case is at best pretty hokey.  If your data design requires using
NULL as though it's a normal data value, you're in a state of sin
already, and you're going to find SQL fighting you all the way.

(A question closely related to this is whether IS NOT DISTINCT FROM
could be optimized more like regular equality.  I'm not convinced
about the use-case there either, although perhaps it's worth looking
into.)

            regards, tom lane



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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: BUG #18442: Unnecessary Sort operator in indexScan Plan
Следующее
От: Richard Guo
Дата:
Сообщение: Re: BUG #18442: Unnecessary Sort operator in indexScan Plan