Re: Fold NOT IN / <> ALL expressions containing NULL to FALSE

From: Denis Smirnov <darthunix(at)gmail(dot)com>
To: Ilia Evdokimov <ilidock95(at)gmail(dot)com>
Cc: Rustam ALLAKOV <rustamallakov(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Fold NOT IN / <> ALL expressions containing NULL to FALSE
Date: 2026-10-20 03:14:56
Message-ID: 87457CA6-AEE4-4016-B753-34CCA22A6A22@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Ilia,

Tested on master at 0497318e442, with and without v7:

create temp table t (a int, b int);
insert into t
select i, i from generate_series(1, 100000) i;

create index ti on t (((a not in (42, null)) or b = 1));
analyze t;

set enable_seqscan = off;

explain (costs off)
select * from t where (a not in (42, null)) or b = 1;

master: Index Scan using ti on t
v7: Seq Scan on t
Disabled: true
Filter: (b = 1)

Best regards,
Denis Smirnov

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-10-20 03:16:49 Re: [PG19] ILIKE index scan misses rows with a libc UTF-8 collation on macOS
Previous Message Chao Li 2026-10-20 03:01:53 Interaction between NOT ENFORCED and NOT VALID