Re: Removing const-false IS NULL quals and redundant IS NOT NULL quals
| От | Richard Guo |
|---|---|
| Тема | Re: Removing const-false IS NULL quals and redundant IS NOT NULL quals |
| Дата | |
| Msg-id | CAMbWs4_SVvKOeOj62Ty4z2jtFdnwN_0nsV6KA2F9arvh5rmyVA@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: Removing const-false IS NULL quals and redundant IS NOT NULL quals (Andy Fan <zhihuifan1213@163.com>) |
| Ответы |
Re: Removing const-false IS NULL quals and redundant IS NOT NULL quals
|
| Список | pgsql-hackers |
On Wed, Dec 27, 2023 at 7:38 PM Andy Fan <zhihuifan1213@163.com> wrote:
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)
The detection of self-inconsistent restrictions already exists in
planner.
# set constraint_exclusion to on;
SET
# explain (costs off) select * from a where a > 3 and a is null;
QUERY PLAN
--------------------------
Result
One-Time Filter: false
(2 rows)
Thanks
Richard
planner.
# set constraint_exclusion to on;
SET
# explain (costs off) select * from a where a > 3 and a is null;
QUERY PLAN
--------------------------
Result
One-Time Filter: false
(2 rows)
Thanks
Richard
В списке pgsql-hackers по дате отправления: