Re: Removing const-false IS NULL quals and redundant IS NOT NULL quals

Поиск
Список
Период
Сортировка
От Andy Fan
Тема Re: Removing const-false IS NULL quals and redundant IS NOT NULL quals
Дата
Msg-id 87bkabri49.fsf@163.com
обсуждение исходный текст
Ответ на Removing const-false IS NULL quals and redundant IS NOT NULL quals  (David Rowley <dgrowleyml@gmail.com>)
Ответы Re: Removing const-false IS NULL quals and redundant IS NOT NULL quals  (Richard Guo <guofenglinux@gmail.com>)
Re: Removing const-false IS NULL quals and redundant IS NOT NULL quals  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-hackers
Hi,

David Rowley <dgrowleyml@gmail.com> writes:

>
> Happy to hear other people's thoughts on this patch.  Otherwise, I
> currently don't think the missed optimisation is a reason to block
> what we've ended up with so far.
>
> David
>
> [1] https://postgr.es/m/flat/17540-7aa1855ad5ec18b4%40postgresql.org
>
> [2. application/x-patch; v10-0001-Reduce-NullTest-quals-to-constant-TRUE-or-FALSE.patch]...

Thanks for working on this, an I just get a complaint about this missed
optimisation 7 hours ago..

I also want to add notnullattnums for the UniqueKey stuff as well, by
comparing your implementation with mine,  I found you didn't consider
the NOT NULL generated by filter. After apply your patch:

create table a(a int);
explain (costs off) select * from a where a > 3 and a is null;
             QUERY PLAN              
-------------------------------------
 Seq Scan on a
   Filter: ((a IS NULL) AND (a > 3))
(2 rows)

This is acutally needed by UniqueKey stuff, do you think it should be
added? To save some of your time, you can check what I did in UniqueKey

[1]
https://www.postgresql.org/message-id/attachment/151254/v1-0001-uniquekey-on-base-relation-and-used-it-for-mark-d.patch

-- 
Best Regards
Andy Fan




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

Предыдущее
От: Pavel Borisov
Дата:
Сообщение: Re: Bug in nbtree optimization to skip > operator comparisons (or < comparisons in backwards scans)
Следующее
От: Ranier Vilela
Дата:
Сообщение: Re: Fix Brin Private Spool Initialization (src/backend/access/brin/brin.c)