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

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: BUG #18442: Unnecessary Sort operator in indexScan Plan
Дата
Msg-id CAApHDvpMwFHTnBLC9zWz9U2Sg61dO6NdjWrf0jvwDHTKv-rudg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #18442: Unnecessary Sort operator in indexScan Plan  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #18442: Unnecessary Sort operator in indexScan Plan  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: BUG #18442: Unnecessary Sort operator in indexScan Plan  (Richard Guo <guofenglinux@gmail.com>)
Список pgsql-bugs
On Sat, 20 Apr 2024 at 02:03, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> One example is that given
> "a IS NULL" and "a = b", the EquivalenceClass machinery would
> think it can discard "a = b" and instead emit "b IS NULL",
> which would not give the same answers.

While this is relatively fresh, for the sake of the archives...

Presumably, if a=b is strict then effectively nothing could match as
the strict qual ensures NULLs never match and the IS NULL only allows
NULLs.

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?

If the equality condition isn't strict then won't "b" be NULL if "a" is?

David



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #18443: jsonb_agg issue. Again.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #18442: Unnecessary Sort operator in indexScan Plan